trakt / Plex-Trakt-Scrobbler

Add what you are watching on Plex to trakt.tv
1.45k stars 167 forks source link

Path Issue while running on Windows #453

Open sharkbit opened 7 years ago

sharkbit commented 7 years ago

I have gotten the Dev Branch to "work" on windows but it looks like there are some path issues.

It looks like it is looking for the Prefrences file and DB in the "C:\Program Files (x86)\Plex\Plex Media Server..." folders instead of the "C:\Users\\AppData\Local\Plex Media Server..." path. So it never fully starts Trakt.

com.plexapp.plugins.trakttv.log.txt

Plex Media Server.log.txt

Note: the Main branch breaks well before, in the init.py

sharkbit commented 7 years ago

Fixed Preference issue ".\content\code\fs_migrator.py" Line 42: return os.path.join(Core.plugin_support_path, 'Preferences', 'com.plexapp.plugins.trakttv.xml')

sharkbit commented 7 years ago

So fixed the DB creation issue by modifying 3 variables in .\Trakttv.bundle\Contents\Libraries\Shared\plugin\core\environment.py environment.py.txt

Full file for Pref issue: fs_migrator.py.txt

Now when trying to sync I get "CantOpenError: unable to open database file"... Log atached com.plexapp.plugins.trakttv.log.txt

Could it be trying to open a second connect to the DB? I.E. I clicked 'Sync Now' and it just tries to open the DB without checking if it's already connected?

sharkbit commented 7 years ago

I built a Debian Plex server to test my issues were not platform specific, I found the same issue with profile in the logs,...

I Found the that the wrong path was getting passed for the DB (apsw_ext.py). I hard coded the correct path and file and the Sync worked! .\Trakttv.bundle\Contents\Libraries\Shared\playhouse\apsw_ext.py Line 60 -> def _connect(self, database, kwargs) is having the wrong DB path passed to it. Where is this being changed from the correct env vars?**

sharkbit commented 7 years ago

Found the Variable, Trakt now works for me on windows and Debian systems with these changes. https://github.com/trakt/Plex-Trakt-Scrobbler/pull/455