blacktwin / JBOPS

Just a Bunch Of Plex Scripts
1.71k stars 304 forks source link

Issue with sync_watch_status #227

Closed dpeet closed 4 years ago

dpeet commented 4 years ago

Describe the bug I'm trying to sync watch status from a home user (no plex pass) to a managed user. Using

python3 sync_watch_status.py --userFrom "UserName1 --userTo "Username2" --libraries "Movies"

I'm running into a couple issue. I used my admin token for the PLEX_TOKEN variable. My first issue was

File "sync_watch_status.py", line 384, in <module>
    userFrom, serverFrom = opts.userFrom
ValueError: not enough values to unpack (expected 2, got 1)

I solved that by setting them directly ie

# userFrom, serverFrom = opts.userFrom
userFrom = opts.userFrom
    serverFrom = "kuat"

However, then I get the error

Traceback (most recent call last):
  File "sync_watch_status.py", line 421, in <module>
    watchedFrom = check_users_access(plex_access, userFrom, serverFrom, libraries)
  File "sync_watch_status.py", line 281, in check_users_access
    print(access.get(user))
TypeError: unhashable type: 'list'

When I print out access, it is a gigantic list, so I'm not sure what it's hung up on. Any suggestions?

Link to script with bug/issue https://github.com/blacktwin/JBOPS/blob/master/utility/sync_watch_status.py

Desktop (please complete the following information):

blacktwin commented 4 years ago

Lets start with the first issue:

python3 sync_watch_status.py --userFrom "UserName1 --userTo "Username2" --libraries "Movies"

You are not using the arguments correctly. From the examples at the top of the script:

sync_watch_status.py --userFrom USER1=Server1 --userTo USER2=Server1 --libraries Movies

You are missing the server in the --userFrom and --userTo. If you made any changes, change them back or just redownload the script and try it again with the correct arguments. If you're still having issues reply back. If that fixed it, reply back as well.

dpeet commented 4 years ago

Ah perfect, that got me all the way to "synched watched status".

But when syncing TVShows, I got a whole bunch of

'nonetype' object has no attribute 'split'

What should I do about that error?

blacktwin commented 4 years ago

What are you using for your arguments now? Can you provide more of output?

dpeet commented 4 years ago
python3 sync_watch_status.py --userFrom "user1"=server --userTo "user2"=server --libraries "TV Shows - server"
Connecting to admin server(s) for access info...
Checking Bearbiever's access to kuat
Connecting Bearbiever to kuat...
Finding watched items in libraries...
Connecting Bearbiever Managed to kuat...
Checking Bearbiever's library: 'TV Shows - Kuat' watch statuses...
Marking watched...

after that some of them would match, and sometimes printed the error

'nonetype' object has no attribute 'split'

would go by. Doing it a second time, there were no errors, and I spot checked and it seems to have been successful

blacktwin commented 4 years ago

Here is where it's likely printing out that message. If you see those messages again add the following:

print(e, item.title)

That would at least show you what item caused the error.