Open wales opened 11 months ago
I'm not able to reproduce any issue with Shows or Movies 🤷. You might need to walk through the code to see where the error is happening. Set some debug points where the is filtering through the library.
There is a problem that the unwatched_work
function aborts as soon as one page had no unwatched items. To prevent that, I pulled the filtering out of get_library_media_info
like this:
diff --git a/utility/media_manager.py b/utility/media_manager.py
--- a/utility/media_manager.py (revision e097a07ca55bbb9f60d726f550dfa3ac2358ba56)
+++ b/utility/media_manager.py (date 1705844138305)
@@ -384,16 +384,16 @@
while True:
# Getting all watched history for userFrom
- tt_history = tautulli_server.get_library_media_info(section_id=sectionID,
- start=start, length=count, unwatched=True, date=date)
+ tt_history = tautulli_server.get_library_media_info(section_id=sectionID, start=start, length=count)
if all([tt_history]):
start += count
for item in tt_history:
- _meta = tautulli_server.get_metadata(item['rating_key'])
- if _meta: # rating_key that no longer exists on the Plex server will return blank metadata
- metadata = Metadata(_meta)
- unwatched_lst.append(metadata)
+ if item['play_count'] is None and float(item['added_at']) < date:
+ _meta = tautulli_server.get_metadata(item['rating_key'])
+ if _meta: # rating_key that no longer exists on the Plex server will return blank metadata
+ metadata = Metadata(_meta)
+ unwatched_lst.append(metadata)
continue
elif not all([tt_history]):
break
Describe the bug
media_manager.py behaving inconsistently when using the
unwatched
flag.Initially, running against Film library appeared to work, e.g running..
python3 media_manager.py --libraries Films --select unwatched --date 30 --action show
..would list an output, however running it against
TV
would report no Series to remove, despite there being entries in TautilliAnd now, bizarrely, running the command against either
Films
orTV
produces nothing to remove:Screenshot of items in Films:
Using the
lastPlayed
flag works as intended, but obviously doesn't pick up the unwatched items.