Closed henrik9999 closed 4 years ago
I have a new version coming maybe later today that adds support to ignore items marked as favorite. I will try to get this fixed with that too.
Any updates?
I have pushed a version that should fix the issue. Sorry for the delay, been busy with family and work so I just did a bug fix and will work on new version with more features later.
@henrik9999 Were you able to get this resolved? I am seeing the same error on a fresh install, as of 2 hours ago.
Items to be deleted
Traceback (most recent call last):
File "./media_cleaner.py", line 159, in <module>
list_items(deleteItems)
File "./media_cleaner.py", line 145, in list_items
item_details=item['Name'] + ' - ' + item['UserData']['LastPlayedDate'] + ' - ' + item['UserData']['Key'] + ' - ' + item['Id']
KeyError: 'Key'
After some playing around with this script I was able to determine item['UserData']['Key']
either never was, or is no longer available thru the API. Removing it resolved the error.
Option#1 Find this line:
item_details=item['Name'] + ' - ' + item['UserData']['LastPlayedDate'] + ' - ' + item['UserData']['Key'] + ' - ' + item['Id']
Make it look like this:
item_details=item['Name'] + ' - ' + item['UserData']['LastPlayedDate'] + ' - ' + item['Id']
Option#2 Comment out or delete a couple lines. If you chose option#2 your media will still be deleted as expected, but you will not get a summary of the deleted media at the end.
Comment out lines by adding # in front of them like this:
#item_details=item['Name'] + ' - ' + item['UserData']['LastPlayedDate'] + ' - ' + item['UserData']['Key'] + ' - ' + item['Id']
#print('----' + item_details)
Let me look into this, I have re-opened the issue. I thought I had fixed it, but I guess I missed an instance of the Key value.
For some reason on my server I don't have this issue as all items have the Key value.
I just pushed a new version that removed the other Key value.
I had thought the first fix had removed all references to it, but missed the one on that delete command.
Let me know if it is now working for you.
Thanks @clara-j that seems to have fixed it.
Now it seems like my emby server side does not like these requests. You ever get this from emby? https://pastebin.com/raw/X3jNKqCk
Can you open another issue for this. I want to resolve this one and we can then discuss in the new ticket but looks like a permission issue.
Make sure the user emby is running under has delete permissions on the files/folders for your media. I originally had this when I had docker for emby configured as read only for the folder I was using for media.
Yep. I will open a new issue.
I would also say the original issue posted here is now closed. Unless your update did not solve it for @henrik9999