rivenmedia / riven

Handle your Media Library with ease!
https://rivenmedia.github.io/wiki/
GNU General Public License v3.0
396 stars 54 forks source link

Listrr error when checking against the database #802

Closed gbrlsnts closed 1 month ago

gbrlsnts commented 1 month ago

Hi, I'm getting this error log after adding Listrr with a Netflix movies list. I only have a few movies and requested some shows through Riven to test it: Tulsa King and 1923.

Running the latest 0.16 version.

Thanks!

riven             | 24-10-19 00:59:03 | ���� INFO      | listrr.run - Fetched 165 items from Listrr
riven             | 24-10-19 00:59:03 | ��� ERROR     | event_manager._process_future - Error in future for <Future at 0x7fb8def94a10 state=finished returned generator>: 'str' object has no attribute '_id'
riven             | 24-10-19 00:59:03 | ��� ERROR     | event_manager._process_future - Traceback (most recent call last):
riven             |   File "/riven/src/utils/event_manager.py", line 73, in _process_future
riven             |     result = next(future.result(), None)
riven             |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
riven             |   File "/riven/src/program/db/db_functions.py", line 406, in run_thread_with_db_item
riven             |     program.em.add_item(item, service)
riven             |   File "/riven/src/utils/event_manager.py", line 300, in add_item
riven             |     if not ensure_item_exists_in_db(item):
riven             |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
riven             |   File "/riven/src/program/db/db_functions.py", line 302, in ensure_item_exists_in_db
riven             |     (MediaItem._id == item._id) if item._id is not None else (MediaItem.imdb_id == item.imdb_id)
riven             |                                    ^^^^^^^^
riven             | AttributeError: 'str' object has no attribute '_id'
riven             |
riven             | Traceback (most recent call last):
riven             |   File "/riven/src/utils/event_manager.py", line 73, in _process_future
riven             |     result = next(future.result(), None)
riven             |   File "/riven/src/program/db/db_functions.py", line 406, in run_thread_with_db_item
riven             |     program.em.add_item(item, service)
riven             |   File "/riven/src/utils/event_manager.py", line 300, in add_item
riven             |     if not ensure_item_exists_in_db(item):
riven             |   File "/riven/src/program/db/db_functions.py", line 302, in ensure_item_exists_in_db
riven             |     (MediaItem._id == item._id) if item._id is not None else (MediaItem.imdb_id == item.imdb_id)
riven             | AttributeError: 'str' object has no attribute '_id'
riven             | 24-10-19 00:59:03 | ���� DEBUG     | event_manager._process_future - Service Listrr executed
davidemarcoli commented 1 month ago

@dreulavelle That looks like a side effect of rewriting handling from item to id.

dreulavelle commented 1 month ago

nah, looks like listrr is returning str's instead of items.. I'll fix it

davidemarcoli commented 1 month ago

I think it's good if it returns str and we should map them to items on the shared init of all content services.

dreulavelle commented 1 month ago

@gbrlsnts can you test the new release and let me know if its fixed

gbrlsnts commented 1 month ago

Damn, you are fast. Opened this before sleeping, and there is already a fix. I've tested it and is fixed! Thanks all.