Jump to content

Watched status not set using external player (AndroidTV/UPnP stream)


mpiet

Recommended Posts

Angelblue05

Why is there 47 files changed? Can you point me to where your update lies because it seems you forked a really old version and it includes all the updates we've made over time. There's no way I'm merging this, but I'll manually add it since your pull request is weird. Thanks :)

Edited by Angelblue05
Link to comment
Share on other sites

You probably pulled down the code a while ago and since that time there have been changes, so you need to merge those changes into your fork.

 

Either that or you've inadvertently changed white-space formatting on lots of files which is fairly common.

Link to comment
Share on other sites

Angelblue05

I dont know.... I just followed your link and clicked on "new pull request"

Just tell me which file you modified to make the watched status work for external players, thank you!

 

I see you were working on that Playback branch rather than the default develop branch. Please work on develop and merge there or let me know the filenames you modified so I can grab your code from it.

Edited by Angelblue05
Link to comment
Share on other sites

 

But probably i made a mistake choosing brunch...  "mpiet1 wants to merge 109 commits into master from develop"

I only wanted to put the description into the pull request. Can somebody correct it?

Link to comment
Share on other sites

The confusion here might be that mpiet does not know exactly what a pull request is for.

Exactly. I thought that a pull request is same as a change request...

Link to comment
Share on other sites

Angelblue05

@@kalle

 

I've checked activeplayers and unfortunately it does not include external players. As of right now, there's no way to detect external players, nor the playback position for them within the add-on. This information is simply not provided by Kodi. I'll keep looking for a solution, but I'm losing hope there's one unless I create a flimsy hackaround of sorts (which I want to avoid because I can't maintain this project full time anymore).

 

Edit: I've setup an external player so I could test. Here is what I understand is happening. With

<playcountminimumtime>600</playcountminimumtime>

or whatever value, before 600 will return as 0.0 when requesting the playback position. After 600, it will return 1.0. However I've noticed that if you skip, it messes up the playcount time calculated by Kodi. 

 

The issue really is how to detect that's not a normal position tick without knowing an external player is being used... Anyway, will keep you posted if I figure something out that's not going to mess with regular playback detection.

Edited by Angelblue05
  • Like 1
Link to comment
Share on other sites

@@Angelblue05

Thank you very much for looking into this minor problem using external players.

I'm with you avoiding wired hacks to workaround a missing Kodi feature.

 

Currently I'm using a wrapper script checking playback time and position percent when the playback stops and then set the watched state via JSON a little after the Emby database sync.

 

Thanks, again.

Kalle

Edited by kalle
  • Like 1
Link to comment
Share on other sites

Angelblue05

I think I found a way to get it properly detected. I just have a few more things to look into but I should have a test build for you guys soon.

Link to comment
Share on other sites

Angelblue05

Yes, I mean you could grab the branch build and test it. It is in place and should work (at least according to my testing).

 

Just a few things left to do, but should be useable for the most part.

 

 

Sent from my iPhone using Tapatalk

Link to comment
Share on other sites

My first try was to clone the branch revision-krypton directly into the empty plugin folder. But it dos not work, watched status was not set.

 

Then I removed the Emby for Kodi plugin in Kodi, cleaned all leftovers in the .kodi folder and removed the media databases. So I could done a clean install of the plugin from the zip file downloaded from git/revision-krypton. Basic setting, creating new database - all works. Except the watched status, still not set after playback ends.

 

Here are the relevant lines from the kodi log of the second attempt:

21:42:33.152 T:140211723941632  NOTICE: Process: Stop
21:42:33.152 T:140211723941632  NOTICE: Process: Showing Kodi window
21:42:33.331 T:140211732334336  NOTICE: EMBY.player -> Played_information: {'/hal/videopool/br/Pi - Der Film (1998).mkv': {'refresh_id': u'a785d741af03079b0b30f8be3cb32c4d', 'AudioStreamIndex': 1, 'SubtitleStreamIndex': '', 'currentPosition': 1.0, 'item_id': u'a785d741af03079b0b30f8be3cb32c4d', 'currentfile': '/hal/videopool/br/Pi - Der Film (1998).mkv', 'runtime': 50454568960, 'Type': u'Movie', 'playmethod': u'DirectPlay'}}
21:42:33.343 T:140210465658624  NOTICE: EMBY.websocket_client -> Message: {"MessageType":"UserUpdated","Data":{"Name":"kalle","ServerId":"053d794334104a1b9769fe03fe808351","Id":"4704b739654d45cb8cccb7e2eef85f5b","HasPassword":true,"HasConfiguredPassword":true,"HasConfiguredEasyPassword":false,"LastLoginDate":"2018-01-06T17:35:07.9340350Z","LastActivityDate":"2018-01-06T20:42:33.3395410Z","Configuration":{"AudioLanguagePreference":"ger","PlayDefaultAudioTrack":false,"SubtitleLanguagePreference":"ger","DisplayMissingEpisodes":true,"GroupedFolders":[],"SubtitleMode":"Default","DisplayCollectionsView":false,"EnableLocalPassword":false,"OrderedViews":["7a2175bccb1f1a94152cbd2b2bae8f6d","43cfe12fe7d9d8d21251e0964e0232e2","8a05b0252259a1dbd62df97522638439","11b59b91c52f93e72cf8186b4849a6fa"],"LatestItemsExcludes":["11b59b91c52f93e72cf8186b4849a6fa"],"HidePlayedInLatest":true,"RememberAudioSelections":true,"RememberSubtitleSelections":true,"EnableNextEpisodeAutoPlay":false},"Policy":{"IsAdministrator":true,"IsHidden":true,"IsDisabled":false,"BlockedTags":[],"EnableUserPreferenceAccess":true,"AccessSchedules":[],"BlockUnratedItems":[],"EnableRemoteControlOfOtherUsers":true,"EnableSharedDeviceControl":true,"EnableLiveTvManagement":true,"EnableLiveTvAccess":true,"EnableMediaPlayback":true,"EnableAudioPlaybackTranscoding":true,"EnableVideoPlaybackTranscoding":true,"EnablePlaybackRemuxing":true,"EnableContentDeletion":true,"EnableContentDeletionFromFolders":[],"EnableContentDownloading":true,"EnableSyncTranscoding":true,"EnabledDevices":[],"EnableAllDevices":true,"EnabledChannels":[],"EnableAllChannels":true,"EnabledFolders":[],"EnableAllFolders":true,"InvalidLoginAttemptCount":0,"EnablePublicSharing":false,"RemoteClientBitrateLimit":0}}}
21:42:33.344 T:140210465658624  NOTICE: EMBY.websocket_client -> Message: {"MessageType":"PlaybackStopped","Data":{"SupportedCommands":["MoveUp","MoveDown","MoveLeft","MoveRight","Select","Back","ToggleContextMenu","ToggleFullscreen","ToggleOsdMenu","GoHome","PageUp","NextLetter","GoToSearch","GoToSettings","PageDown","PreviousLetter","TakeScreenshot","VolumeUp","VolumeDown","ToggleMute","SendString","DisplayMessage","SetAudioStreamIndex","SetSubtitleStreamIndex","SetRepeatMode","Mute","Unmute","SetVolume","Play","Playstate","PlayNext"],"PlayableMediaTypes":["Audio","Video"],"Id":"26b294a4185218cb3380687c9182e7b5","ServerId":"053d794334104a1b9769fe03fe808351","UserId":"4704b739654d45cb8cccb7e2eef85f5b","UserName":"kalle","AdditionalUsers":[],"ApplicationVersion":"3.0.0","Client":"Kodi","LastActivityDate":"2018-01-06T20:42:33.3413910Z","DeviceName":"htpc","DeviceId":"1808E50D1CF1455CAFABF3D49D9BF028","SupportsRemoteControl":true,"PlayState":{"CanSeek":false,"IsPaused":false,"IsMuted":false,"RepeatMode":"RepeatNone"}}}
21:42:33.346 T:140211732334336  NOTICE: EMBY.player -> Percent complete: 0.000198198105863 Mark played at: 0.95
21:42:33.348 T:140211732334336   ERROR: GetDirectory - Error getting /home/kalle/.kodi/userdata/addon_data/plugin.video.emby/temp/
21:42:33.389 T:140211732334336  NOTICE: EMBY.kodimonitor -> Method: VideoLibrary.OnUpdate Data: {"item":{"id":1335,"type":"movie"},"playcount":1}
21:42:33.390 T:140211732334336  NOTICE: EMBY.database -> opened: /home/kalle/.kodi/userdata/Database/emby.db - 140211696293512
21:42:33.390 T:140211732334336  NOTICE: EMBY.database -> Verifying emby DB
21:42:33.413 T:140211732334336  NOTICE: EMBY.database -> closing: /home/kalle/.kodi/userdata/Database/emby.db - 140211696293512
21:42:33.414 T:140211732334336  NOTICE: EMBY.kodimonitor -> Method: VideoLibrary.OnUpdate Data: {"id":1335,"type":"movie"}
21:42:33.414 T:140211732334336  NOTICE: EMBY.kodimonitor -> Item is invalid for playstate update
21:42:33.859 T:140210465658624  NOTICE: EMBY.websocket_client -> Message: {"MessageType":"UserDataChanged","Data":{"UserId":"4704b739654d45cb8cccb7e2eef85f5b","UserDataList":[{"PlaybackPositionTicks":0,"PlayCount":1,"IsFavorite":false,"LastPlayedDate":"2018-01-06T19:15:26.5522380Z","Played":false,"Key":"473","ItemId":"a785d741af03079b0b30f8be3cb32c4d"},{"UnplayedItemCount":118,"PlaybackPositionTicks":0,"PlayCount":0,"IsFavorite":false,"Played":false,"Key":"e4594a50-36b3-0fb5-20ac-d16dadd70cf7","ItemId":"e4594a5036b30fb520acd16dadd70cf7"}]}}
21:42:33.859 T:140210465658624  NOTICE: EMBY.librarysync -> Queue userdata: [u'a785d741af03079b0b30f8be3cb32c4d', u'e4594a5036b30fb520acd16dadd70cf7']
21:42:34.134 T:140211354859264  NOTICE: EMBY.database -> opened: /home/kalle/.kodi/userdata/Database/emby.db - 140211696291888
21:42:34.135 T:140211354859264  NOTICE: EMBY.database -> Verifying emby DB
21:42:34.136 T:140211354859264  NOTICE: EMBY.database -> opened: /home/kalle/.kodi/userdata/Database/MyVideos107.db - 140211696293512
21:42:34.139 T:140211354859264  NOTICE: EMBY.database -> opened: /home/kalle/.kodi/userdata/Database/MyMusic60.db - 140211696293048
21:42:34.181 T:140211354859264  NOTICE: EMBY.objects.movies -> Update playstate for movie: Pi - Der Film fileid: 1335
21:42:34.184 T:140211354859264  NOTICE: EMBY.database -> closing: /home/kalle/.kodi/userdata/Database/MyMusic60.db - 140211696293048
21:42:34.184 T:140211354859264  NOTICE: EMBY.database -> number of rows updated: 1
21:42:34.187 T:140211354859264  NOTICE: EMBY.database -> commit: /home/kalle/.kodi/userdata/Database/MyVideos107.db
21:42:34.187 T:140211354859264  NOTICE: EMBY.database -> closing: /home/kalle/.kodi/userdata/Database/MyVideos107.db - 140211696293512
21:42:34.188 T:140211354859264  NOTICE: EMBY.database -> number of rows updated: 1
21:42:34.190 T:140211354859264  NOTICE: EMBY.database -> commit: /home/kalle/.kodi/userdata/Database/emby.db
21:42:34.190 T:140211354859264  NOTICE: EMBY.database -> closing: /home/kalle/.kodi/userdata/Database/emby.db - 140211696291888
Link to comment
Share on other sites

Angelblue05

Provide the full log. The important stuff happens when you start playback, not when you stop it. It works for me. I've setup an external player and it marks 100%.

Sent from my iPhone using Tapatalk

Edited by Angelblue05
Link to comment
Share on other sites

Angelblue05

You can test using the beta version of Emby for Kodi. If it doesn't work, please provide your complete log (PM is also an option).

Link to comment
Share on other sites

Thanks @Angelblue05.

I'm using the beta repository now. But watched state is still not working for me.

A complete kodi log is attached.

 

Edited by Angelblue05
Link to comment
Share on other sites

Angelblue05

Ok thank you, I will have a look.

Edit: I see the issue. I'll post a fix soon.

Sent from my iPhone using Tapatalk

Edited by Angelblue05
Link to comment
Share on other sites

I'm not sure. Yesterday I updated the plugin to 3.0.2a from beta repository. But it doesn't seem to work.

 

I will check again and provide a log a little later this day.

Link to comment
Share on other sites

Sorry, for the delay.

 

With 3.0.2a of the addon automatically setting the watched state sill does not work for me.

Attached a log with a short play on the internal VideoPlayer and two episodes on an external player.

 

Thanks for your effort.

Please let me know if a debug log would help.

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...