Closed daveonkels closed 1 year ago
Can you try running this with DEBUG_LEVEL="debug"
This will spit out a lot more information but should show us what it finds on the gathering steps and we can see if something is going wrong with my cleaning function.
I had that enabled as well but wasn't seeing anything that explained the issue. Here's what is displayed if I leave TV Shows active:
Server 1: plex <src.plex.Plex object at 0x7f9d68b52c90>
Server 2: jellyfin <src.jellyfin.Jellyfin object at 0x7f9d68acb090>
Plex: Generating watched for <<PLEXUSERNAME>> in library Movies
Plex: Generating watched for <<PLEXUSERNAME>> in library TV Shows
Jellyfin: Generating watched for <<JELLYFINUSERNAME>> in library Movies
Jellyfin: Generating watched for <<JELLYFINUSERNAME>> in library Shows
Jellyfin: Generating watched for <<JELLYFINUSERNAME>> in library Collections
[DEBUG]: Server 1 watched: {'cooper2050': {'Movies': [], 'TV Shows': {frozenset({('tmdb', '90669'), ('tvdb', '384429'), ('locations', ('1899',)), ('imdb', 'tt9319668'), ('title', '1899')}): {'Season 1': [{'imdb': 'tt14574184', 'tmdb': '3915213', 'tvdb': '9348590', 'locations': ('1899 - 01x05 - The Calling.mkv',)}]}, frozenset({('tvdb', '279536'),<<REDACTED FOR BREVITY>>{'tvdb': '9342109', 'imdb': 'tt15800778', 'locations': ('The Peripheral - 01x05 - What About Bob.mkv',)}, {'tvdb': '9342110', 'imdb': 'tt15801370', 'locations': ('The Peripheral - 01x06 - Fuck You and Eat Shit.mkv',)}]}, frozenset({('tmdb', '90669'), ('tvdb', '384429'), ('locations', ('1899',)), ('imdb', 'tt9319668'), ('title', '1899')}): {'Season 1': [{'tvdb': '9348590', 'imdb': 'tt14574184', 'locations': ('1899 - 01x05 - The Calling.mkv',)}]}}}}
[ERROR]: Plex: Library Shows not found in library list
[ERROR]: Jellyfin: Library TV Shows not found in library list
Average time: 19.231942122103646
Looping in 3600.0
As you can see it's almost as if it's not seeing any movies, even though it seems to indicate finding the libraries.
can you try the dev branch and run it with that debug_level="debug" and post the full log with anything you want redacted still. I found some issues but not sure if your issue was one of them.
Thanks - just to confirm, the process to build from the dev branch would be:
git clone --single-branch --branch=dev https://github.com/luigi311/JellyPlex-Watched.git
then cd into the folder and
docker build -t jellyplex-watched .
followed by this to run
docker run --rm -it -e DEBUG_LEVEL="debug" -e DRYRUN="False" -e PLEX_TOKEN="REDACTED" -e PLEX_BASEURL="http://REDACTED" -e JELLYFIN_TOKEN="REDACTED" -e JELLYFIN_BASEURL="https://jellyfin.tarscase.com" jellyplex-watched
If this is the case, my output is fairly similar:
Server 1: plex <src.plex.Plex object at 0x7f7770d4a4d0>
Server 2: jellyfin <src.jellyfin.Jellyfin object at 0x7f7770d219d0>
Plex: Generating watched for REDACTED in library Movies
Plex: Generating watched for REDACTED in library TV Shows
Jellyfin: Generating watched for REDACTED in library Movies
Jellyfin: Generating watched for REDACTED in library Shows
Jellyfin: Generating watched for REDACTED in library Collections
[DEBUG]: Server 1 watched: {'REDACTED': {'Movies': [], 'TV Shows': {frozenset({('imdb', 'tt9319668'), ('locations', ('1899',)), ('title', '1899'), ('tvdb', '384429'), ('tmdb', '90669')}): {'Season 1': [{'imdb': 'tt14574184', 'tmdb': '3915213', 'tvdb': '9348590', 'locations': ('1899 - 01x05 - The Calling.mkv',)}]}, frozenset({('tvdb', '279536'), ('title', 'Billions'), ('tmdb', '62852'), ('locations', ('Billions',)), ('imdb', 'tt4270492')}): {'Season 4': [{'imdb': 'tt8490712', 'tmdb': '1647355', 'tvdb': '6945782', <<REDACTED>> {'tvdb': '9342109', 'imdb': 'tt15800778', 'title': 'What About Bob?', 'locations': ('The Peripheral - 01x05 - What About Bob.mkv',)}, {'tvdb': '9342110', 'imdb': 'tt15801370', 'title': 'Fuck You and Eat Shit', 'locations': ('The Peripheral - 01x06 - Fuck You and Eat Shit.mkv',)}]}, frozenset({('imdb', 'tt9319668'), ('locations', ('1899',)), ('title', '1899'), ('tvdb', '384429'), ('tmdb', '90669')}): {'Season 1': [{'tvdb': '9348590', 'imdb': 'tt14574184', 'title': 'The Calling', 'locations': ('1899 - 01x05 - The Calling.mkv',)}]}}}}
Average time: 18.056319360155612
Looks like there was an issue with some of the logging so i fixed that and added way more logging so we should hopefully see what is going on. Go ahead and do a git pull and rebuild the docker image and run your command again and add -e DEBUG="true". You should see a lot more debugging information.
So I re-ran the latest build and am happy to share the output but it didn't explain much more. That said, I kept tinkering with the settings - particularly focusing on Jellyfin since the logs indicated there was nothing to match against. Not sure if it was something to do with my Jellyfin setup but on a whim, I renamed my Movie library to Cinema and bam - it worked like a champ! Maybe that unstuck something or maybe your script struggled with libraries of the same name?
Theres no reason it shouldnt work with the name Movies. I have my named Movies on both plex and jellyfin can you post the log before the name change just so i can see it.
Apologies, I can't recreate the problem now. Renamed the library back to "Movies" and the sync still works for both TV Shows and Movies.
So I think I have the same problem that @daveonkels had previously - and it appears to be due to having multiple folders in each library (as for me, I had the issue with TV Shows as well). I have two folders for Movies (4k and non-4k) and same for TV. And when it does the search, it only returns the top level. When I modify the query for jellyfin_search to include recursive folders, but filtered for either Movie or Series, it seems to work ok (I think)
`jellyfin_search = await self.query( f"/Users/{user_id}/Items"
`jellyfin_search = await self.query( f"/Users/{user_id}/Items"
Attempting to sync from Jellyfin to Plex and have no issues with TV Shows but the script seems to ignore the Movies sync. I've run a number of variations including explicitly whitelisting Movies and doing a manual mapping of the libraries (Movies:Movies) to no avail. Are there any other adjustments I should be looking at or other ways to debug?
docker run --rm -it -e LOGFILE="log.log" -e LIBRARY_MAPPING='{ "movies": "Movies" }' -e WHITELIST_LIBRARY="Movies" -e BLACKLIST_LIBRARY_TYPE="TV Shows" -e USER_MAPPING='{ "redacted": "redacted" }' -e SLEEP_DURATION="3600" -e DEBUG_LEVEL="info" -e DRYRUN="False" -e PLEX_TOKEN="redacted" -e PLEX_BASEURL="http://10.10.0.128:32400" -e JELLYFIN_TOKEN="redacted" -e JELLYFIN_BASEURL="https://jellyfin.redacted.com" luigi311/jellyplex-watched:latest