Author: Adam <git@apiote.tk>
show watched episodes only of current user in TV queue
db/db.go | 2 +-
diff --git a/db/db.go b/db/db.go index d1ea424da0ebcac6fdd59850d7f07178252357e7..90e041fc25c069642c66ba889c67aa915a6c9403 100644 --- a/db/db.go +++ b/db/db.go @@ -717,7 +717,7 @@ if filter != "" { whereClause = "and c1.title like '%" + filter + "%'" } - rows, err := db.Query(`select item_id, episodes_watched, cover, status, based_on, genres, title, year_start, year_end, substr(e.id, 1, pos-1) as series_id from wantlist w left join (select count(time) as episodes_watched, item_id as id, instr(item_id, '/') as pos from experiences where item_type = 'tvserie' and time != '0001-01-01 00:00:00+00:00' group by substr(id, 1, pos-1)) e on item_id = series_id natural join item_cache c where item_type = 'tvserie' and username = ? `+whereClause+` order by title limit ?,18`, username, offset) + rows, err := db.Query(`select item_id, episodes_watched, cover, status, based_on, genres, title, year_start, year_end, substr(e.id, 1, pos-1) as series_id from wantlist w left join (select count(time) as episodes_watched, item_id as id, instr(item_id, '/') as pos from experiences where item_type = 'tvserie' and time != '0001-01-01 00:00:00+00:00' and username = ? group by substr(id, 1, pos-1)) e on item_id = series_id natural join item_cache c where item_type = 'tvserie' and username = ? `+whereClause+` order by title limit ?,18`, username, username, offset) if err != nil { fmt.Fprintf(os.Stderr, "Select err: %v\n", err)