ShokoServer icon indicating copy to clipboard operation
ShokoServer copied to clipboard

The 'Sync Plex Watch Status' Command Is Not Functioning on Certain Setups

Open natyusha opened this issue 2 years ago • 4 comments

Thanks to Cazarr recently adding some extra logging in the daily it seems to be confirmed why the Sync Plex Watch Status command is failing to function on certain setups.

VERSION INFORMATION

Server Version: Latest Daily

Desktop Version: Latest Daily

LOG FILE

2023-08-24 14:03:52 Info  | Processing episode Infiltrators of 009-1
2023-08-24 14:03:52 Trace | Episode not found in Shoko, skipping - M:\Anime\009-1\009-1 - 01.mkv (M:\Anime\009-1\009-1 - 01.mkv)

DESCRIPTION

When running the Sync Plex Watch Status command the entire Plex library is scanned but no watched states make it back to ShokoServer (the episodes are not found). The log excerpt above coupled with the screenshot below (which shows the expected paths) should demonstrate what is going wrong. The file paths need to be converted from their local M:\Anime\009-1\009-1 - 01.mkv paths back into their server /anime/009-1/009-1 - 01.mkv paths for ShokoServer to be able to find the files.

ShokoDesktop_2023-08-24_17-46-27

STEPS TO REPRODUCE

The above example has Plex installed on Windows alongside ShokoDesktop while ShokoServer is running in a docker container on unRAID.

natyusha avatar Sep 03 '23 13:09 natyusha

The main problem right now is trying to find a way to properly map the file to the right place.

Cazzar avatar Sep 04 '23 04:09 Cazzar

Couldn't this be resolved by comparing the parent foldername + filename instead of the full path like in the Plex agent?

var linPath = (@"/anime/009-1/009-1 - 01.mkv");
var linDir = Path.GetFileName(Path.GetDirectoryName(linPath));
var linFil = Path.GetFileName(linPath);
var linPar = Path.Combine(linDir, linFil);
Console.WriteLine(linPar);

Console Output: 009-1/009-1 - 01.mkv

natyusha avatar Nov 18 '23 16:11 natyusha

@Cazzar please correct me if I'm wrong but syncing does work for the following cases.

  • Shoko and Plex on same system.
  • Shoko and Plex on different systems but same OS.

The issue seems to be when Shoko and Plex are on different systems with different OS?

ElementalCrisis avatar Dec 31 '23 09:12 ElementalCrisis

@natyusha that will not work, as it is not the issue at all. The issue itself is the mismatch of the path separator character when plex and shoko are on differing OS systems.

The issue is a low priority ultimately

Cazzar avatar Dec 31 '23 09:12 Cazzar