Jump to content

Server events


Angelblue05

Recommended Posts

Angelblue05

Just a post to group up server events requests. You are welcomed to post here if your request is regarding this subject.

 

@@Luke

 

When updating a movie trailer (changing from youtube to a local trailer), the server does not trigger an update event. Can this be changed?

 

Thank you.

Link to comment
Share on other sites

If the movie was saved to the database then an update event should go out. did you not wait long enough? it can take a minute or two.

Link to comment
Share on other sites

Angelblue05

It is, and waited longer than 5 mins. So this is not expected behavior? Will do more troubleshooting then. Thank you.

Edited by Angelblue05
Link to comment
Share on other sites

  • 3 months later...
roblav96

Just a post to group up server events requests. You are welcomed to post here if your request is regarding this subject.

 

@@Luke

 

When updating a movie trailer (changing from youtube to a local trailer), the server does not trigger an update event. Can this be changed?

 

Thank you.

 

When you say server events, are you referring to websocket events? If so then yes there are quite a bit of missing server events.

 

I eventually gave up on trying to listen for server websocket events and decided to:

tail -f ~/.config/emby-server/logs/embyserver.txt

from a child_process in nodejs.

 

https://github.com/roblav96/futon-media/blob/e095fb9e84f4f3a29872e3f1c708a7c0bb893079/src/emby/emby/tail.ts#L99

 

It basically regex matches http calls to the server to better understand what's going on.

Link to comment
Share on other sites

Angelblue05

Yes I did mean websocket events.

 

I don’t know if the particular scenario I reported has been fixed. When a trailer is being replace, Emby should trigger an update event for that item.

 

The other event would be after an item is blocked, no update event is received for that particular user, it seemed like that was unexpected.

 

Otherwise it looks good from where I stand... btw will you finish plugging in the MinDateLastSavedForUser? I can’t tell if it works, it seems to return the same result as MinDateLastSaved,

Link to comment
Share on other sites

 

 

I don’t know if the particular scenario I reported has been fixed. When a trailer is being replace, Emby should trigger an update event for that item.

 

Any metadata edit should trigger LibraryChanged and include the item in ItemUpdated. I tested this yesterday when we were discussing it, and used the chrome debugger to monitor the messages coming through. The messages are not instant and can sometimes take up to a minute.

Link to comment
Share on other sites

 

 

Otherwise it looks good from where I stand... btw will you finish plugging in the MinDateLastSavedForUser? I can’t tell if it works, it seems to return the same result as MinDateLastSaved, 

 

We have to first start tracking date changes on user data, that's something we don't currently do, but luckily we'll need it in the near future for multiple things.

  • Like 1
Link to comment
Share on other sites

Angelblue05

Any metadata edit should trigger LibraryChanged and include the item in ItemUpdated. I tested this yesterday when we were discussing it, and used the chrome debugger to monitor the messages coming through. The messages are not instant and can sometimes take up to a minute.

I will retest on my side to confirm for the trailers once I'm able to access my movies again. Spinning circle atm.

 

For the blocked tag, to recap I added the tag "block" to the user parental access policy. Then, I went into the library, added the tag to a movie, the movie disappears as supposed. The update event is received on the user account that doesn't block content, while no event is received on the user account the content is now blocked on. Is this what you are seeing? I waited long enough to see it trigger on my second Kodi session so I'm sure it's not working right and no event is received once the item is blocked on that account. I'd like to see the update event go through and then go silent instead.

Edited by Angelblue05
Link to comment
Share on other sites

I will retest on my side to confirm for the trailers once I'm able to access my movies again. Spinning circle atm.

 

For the blocked tag, to recap I added the tag "block" to the user parental access policy. Then, I went into the library, added the tag to a movie, the movie disappears as supposed. The update event is received on the user account that doesn't block content, while no event is received on the user account the content is now blocked on. Is this what you are seeing? I waited long enough to see it trigger on my second Kodi session so I'm sure it's not working right and no event is received once the item is blocked on that account. I'd like to see the update event go through and then go silent instead.

Oh yea that's true because by the time the message goes out, the user no longer has access to the content.

Link to comment
Share on other sites

roblav96

Missing events? What events would you like?

 

Mainly events when a User does an action, a few off the top of my head,

  • User favorites an Item
  • User presses `Play` on an Item, as opposed to when the media starts playing
  • User types into the search bar
  • User enters/leaves viewing an Item/Folder/Person

Example being, instead of enabling `download all subtitles ahead of time` in a Library config, dynamically download subtitles as needed. Which reminds me, the `LibraryChanged` event does not trigger when subtitles are downloaded.

 

Of the events the server does emit, it's not for about a minute till the client receives them, so it's kinda useless :/

 

We have to first start tracking date changes on user data, that's something we don't currently do, but luckily we'll need it in the near future for multiple things.

 

Since the Session does track date changes, I've intertwined a User and their Session into one object.

Link to comment
Share on other sites

Angelblue05

User favorites an item already exists with UserDataChanged

 

The rest I can't say.

Link to comment
Share on other sites

Yes that's correct. The rest would have to be added, but those are really real-time actions.

Link to comment
Share on other sites

Angelblue05

@@Luke

 

One more thing. When refreshing metadata for a title that has a theme, it will send the theme to be updated as well. Intended? How can I know it's a theme? It should not be synced but it is type audio so it falls into music, which has no way of validating the parent library. Any way to give them their own type? Same with audiobooks which are type song?

 

If it's due to playback, then I thought that's what the MediaType field was for. But the Type field should be unique per item type? It makes it really difficult to deal with long term.

Link to comment
Share on other sites

When you refresh something it refreshes all owned items such as the themes. Just the very act of that will cause them to get saved and report events.

 

To know it's a theme you should be able to check the ExtraType property. But I'll see if it makes sense to not have them trigger events.

Link to comment
Share on other sites

Angelblue05

ExtraType property, does it go under fields? I am not familiar with this. I don't mind the update, I just wish the information at item level was more useful. If I knew it was a theme, then I can trigger the proper update. This ends up masking information that can be useful.

 

I can't support audio books because of this reason. Kodi uses type music or type video. Only type video can set a resume point. With type audio being returned for the audio book, it will be treated as a song and that messes up the playlist playback if a resume point is indeed added to a song. Anyway, long story short, I had to remove the feature, but I would really like to support it as I do use audio books in Emby or at least I'd like to include it in my daily usage.

 

Thanks for your consideration :)

Edited by Angelblue05
Link to comment
Share on other sites

I will just filter them out for now as I don't think anyone is doing anything with them on change events.

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...