diff options
Diffstat (limited to 'p2pvr/lib/sql/Schedules_GetCandidates.sql')
-rw-r--r-- | p2pvr/lib/sql/Schedules_GetCandidates.sql | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/p2pvr/lib/sql/Schedules_GetCandidates.sql b/p2pvr/lib/sql/Schedules_GetCandidates.sql index 1b9441b..aa6ec0f 100644 --- a/p2pvr/lib/sql/Schedules_GetCandidates.sql +++ b/p2pvr/lib/sql/Schedules_GetCandidates.sql @@ -10,11 +10,11 @@ and sv.serviceid = e.serviceid and e.starttime > now() and not exists ( select 1 - from seen - where lower(e.title) = lower(seen.title) - and coalesce(lower(e.subtitle), '') = coalesce(lower(seen.subtitle), '') - and ts_rank(to_tsvector(e.description), plainto_tsquery(seen.description)) + - ts_rank(to_tsvector(seen.description), plainto_tsquery(e.description)) > 1) + from recorded r + where lower(e.title) = lower(r.title) + and coalesce(lower(e.subtitle), '') = coalesce(lower(r.subtitle), '') + and ts_rank(to_tsvector(e.description), plainto_tsquery(r.description)) + + ts_rank(to_tsvector(r.description), plainto_tsquery(e.description)) > 1) group by e.serviceid, e.eventid, sv.serviceid order by max(s.priority) desc, e.title, e.subtitle, e.description, sv.transportstreamid, e.starttime |