Jump to content

Trakt Sync Issues


Keelan

Recommended Posts

Keelan

Trying to come over from Plex but i use trakt to sync my playstates etc. So it would be nice to bring them over with emby too.

 

I have read through: http://emby.media/community/index.php?/topic/17179-trakt-v2-api-update

 

People seem to say the following issue is resolved but i canno't seem to get my trakt plugin to sync all my watched items. User and password is correct. I know recently trakt introduced a device auth type system not sure if this is now required over a username and password?

 

http://docs.trakt.apiary.io/#reference/authentication-devices

2016-03-14 01:01:06.7441 Error HttpClient: Error getting response from https://api-v2launch.trakt.tv/sync/history/remove
	*** Error Report ***
	Version: 3.0.5882.0
	Command line: C:\Users\Keelan\AppData\Roaming\Emby-Server\system\MediaBrowser.ServerApplication.exe -service
	Operating system: Microsoft Windows NT 6.2.9200.0
	Processor count: 4
	64-Bit OS: True
	64-Bit Process: True
	Program data path: C:\Users\Keelan\AppData\Roaming\Emby-Server
	Application Path: C:\Users\Keelan\AppData\Roaming\Emby-Server\system\MediaBrowser.ServerApplication.exe
	One or more errors occurred.
	System.AggregateException
	   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
	   at MediaBrowser.Common.Implementations.HttpClientManager.HttpClientManager.<SendAsyncInternal>d__1b.MoveNext()
	InnerException: System.Net.WebException
	The remote server returned an error: (504) Gateway Timeout.
	   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
	   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
	
2016-03-14 01:01:06.7441 Info HttpClient: HttpClientManager POST: https://api-v2launch.trakt.tv/sync/history/remove
2016-03-14 01:01:43.8439 Error Trakt: Error updating episode play states
	*** Error Report ***
	Version: 3.0.5882.0
	Command line: C:\Users\Keelan\AppData\Roaming\Emby-Server\system\MediaBrowser.ServerApplication.exe -service
	Operating system: Microsoft Windows NT 6.2.9200.0
	Processor count: 4
	64-Bit OS: True
	64-Bit Process: True
	Program data path: C:\Users\Keelan\AppData\Roaming\Emby-Server
	Application Path: C:\Users\Keelan\AppData\Roaming\Emby-Server\system\MediaBrowser.ServerApplication.exe
	Object reference not set to an instance of an object.
	System.NullReferenceException
	   at Trakt.ScheduledTasks.SyncLibraryTask.LogTraktResponseDataContract(TraktSyncResponse dataContract)
	   at Trakt.ScheduledTasks.SyncLibraryTask.<SyncUserLibrary>d__23.MoveNext()
Edited by Keelan
Link to comment
Share on other sites

Keelan

I think there is a scheduled task to make it sync downwards. have you tried that?

 

I had both Import playstates from trak.tv and sync library to trakt.tv scheduled

 

Basically it ignored anything on trakt and just updates trakt saying i haven't watched anything within emby (which is true). But i have watched shows on other sources according to trakt.

 

Eventually i will have more than one emby server. Then use trakt to sync what i have watched across them all.

 

I currently do this with my 3 plex servers. This way 3 servers in different locations, home, work, parents house are all synced for my user.

Link to comment
Share on other sites

ginjaninja

i use trakt plugin on more than one media server.

i dont use the "sync library to track" task, because i think i found what you are describing,

I just let emby scrobble to trakt and import play states...this keeps emby up to date with what others media servers have told trakt.

 

This works for me...maybe as both my media servers have the same content.

you probably also have both media servers with the same content, so i think it should work for you...just dont sync library

Link to comment
Share on other sites

SilentException

Yes, I noticed the same. Plugin doesn't sync Trakt changes down to Emby. Hope it can be fixed..

 

I sometimes watch episodes and mark them watched on Trakt before adding them to Emby. After I add them to Emby, watchstates on Trakt are cleared...

Link to comment
Share on other sites

ginjaninja

I dont experience that issue, but my content is always registered in both servers before one plays it (then syncs to trakt and then emby retrives that watched status)

 

The purpose of trakt is for it to be the master arbiter of watched status, so maybe the plugin architecture needs to be updated to support query of watched status from trakt and apply it on initial import into the library.

 

Or more simply apply trakt status to library, before library status is applied to trakt...actual scrobbles would need to take precedence otherwise nothing would ever get watched on trakt.

 

 

 

Sent from my GT-I9505 using Tapatalk

Edited by ginjaninja
Link to comment
Share on other sites

  • 10 months later...
SilentException

Sorry for bringing the old thread up but I think I figured out why this happens (sometimes). Looking at the code on github, Trakt plugin has two scheduled tasks: import playstates and sync library. Problem is that second task (sync library) uses data from the first task (import playstates) without checking the "freshness" of the data. It can happen that the two tasks run few or more hours apart. Let's say import playstates ran at 3PM and sync library at 6PM. If you mark items watched on trakt.tv website or using any other software in this timeframe (3pm to 6pm), sync library task will wipe the playstates on trakt (because it uses data from 3PM).

 

I now set the two task triggers to run two times daily:

 

Import playstates: 5:30AM / 3:30PM

Sync library: 5:35AM / 3:35PM

 

While this is not the proper solution, this minimizes the chance of the bug showing, because it ensures two tasks run one after another.

 

Hope this makes sense and can be properly fixed. For example update the trakt data on each task, not just in import playstates task.

 

Thanks.

Link to comment
Share on other sites

Hi @@SilentException, thanks for the report. i think by default the tasks are set to never run at all which means they are always user invoked. if they are always user invoked then this can be paid attention to (although not intuitive or ideal).

 

Personally I like the idea of just overhauling the plugin so that everything is just automatic and the tasks aren't even needed.

Link to comment
Share on other sites

SilentException

Well, the tasks are needed if you want to keep the watched statuses in sync. Otherwise it would be one way sync or scrobble only which is far from ideal. Personally I think that the second task should just pull the trakt data again and not use the existing "cache" from first task. This request takes less than a second after all.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...