Jump to content

New Plugin: Discord Notifications


rechigo

Recommended Posts

grafxxx

So after reinstalling the plugin the server crashes after a library scan again. BUT before it crashes, it sends enriched info to discord ;). But as you can see on the image it's doubled. One time enriched and the other blank.

IMG_717333F6710B-1.jpeg

embyserver-63757189974.txt

Link to comment
Share on other sites

BillOatman
4 hours ago, grafxxx said:

So after reinstalling the plugin the server crashes after a library scan again. BUT before it crashes, it sends enriched info to discord ;). But as you can see on the image it's doubled. One time enriched and the other blank.

IMG_717333F6710B-1.jpeg

embyserver-63757189974.txt 172.13 kB · 3 downloads

Looks like it processed a bunch of them then failed on one.  Maybe a timing thing. Since I don't run the thing I won't be able to debug it.  Hopefully someone who uses it can take a look.

Link to comment
Share on other sites

rechigo
Posted (edited)
2 hours ago, BillOatman said:

Looks like it processed a bunch of them then failed on one.  Maybe a timing thing. Since I don't run the thing I won't be able to debug it.  Hopefully someone who uses it can take a look.

This issue started popping up a while ago, I think it was around the time when I stopped working on this plugin. It's some edge case somewhere in the metadata checker that causes the entire server to essentially kill itself when it occurs. 

 

On other news, I have officially released an update onto Github at long last, the original post has been updated with the new download.

https://github.com/oonqt/Emby.Notifications.Discord/releases/tag/1.1.1.2

 

Unfortunately for Beta users, you will have to wait until the next cycle of Beta releases as I was unable to build the plugin against the Emby Server 4.6.0.48 SDK as it was removed from NuGet. This should only take a week or two for the new betas to come out hopefully.

Edited by rechigo
  • Thanks 1
Link to comment
Share on other sites

BillOatman
Posted (edited)
5 hours ago, rechigo said:

This issue started popping up a while ago, I think it was around the time when I stopped working on this plugin. It's some edge case somewhere in the metadata checker that causes the entire server to essentially kill itself when it occurs. 

 

On other news, I have officially released an update onto Github at long last, the original post has been updated with the new download.

https://github.com/oonqt/Emby.Notifications.Discord/releases/tag/1.1.1.2

 

Unfortunately for Beta users, you will have to wait until the next cycle of Beta releases as I was unable to build the plugin against the Emby Server 4.6.0.48 SDK as it was removed from NuGet. This should only take a week or two for the new betas to come out hopefully.

I think the issue might stem from the fact that the code is adding/removing from that dictionary asynchronously and dictionaries are not thread safe.

Quote

A Dictionary can support multiple readers concurrently, as long as the collection is not modified. Even so, enumerating through a collection is intrinsically not a thread-safe procedure. In the rare case where an enumeration contends with write accesses, the collection must be locked during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

For a thread-safe alternative, see ConcurrentDictionary.

 

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

BillOatman

OK brave people ... I replaced that questionable dictionary code and rebuilt.  I make no guarantees on what it will do as I cannot run it. If you like, particularly high volume people that see this problem, give it a try.

 

 

Emby.Notifications.Discord1113.dll.zip

Link to comment
Share on other sites

rechigo
2 hours ago, BillOatman said:

I think the issue might stem from the fact that the code is adding/removing from that dictionary asynchronously and dictionaries and not thread safe.

 

And here my lack of C# knowledge shines, hopefully that is the issue.

Link to comment
Share on other sites

BillOatman

Any feedback?  If it is working for people I'll get it to rechigo to release.

Link to comment
Share on other sites

GrimReaper
16 minutes ago, BillOatman said:

Any feedback?  If it is working for people I'll get it to rechigo to release.

113 working fine here on 4.6.0.50. Occasional hiccup when larger number of items (10+) added simultaneously, part of notifications come through un-enriched, but no server crashes, can live with that trade. 

Link to comment
Share on other sites

BillOatman
5 minutes ago, GrimReaper76 said:

113 working fine here on 4.6.0.50. Occasional hiccup when larger number of items (10+) added simultaneously, part of notifications come through un-enriched, but no server crashes, can live with that trade. 

Yeah that's the situation that was crashing it before I believe.  I can try something later that might help.  Thanks.

Link to comment
Share on other sites

BillOatman

New test version that replaces dictionaries with queues.  Hopefully should not crash and should always send the rich data notifications.  This is a significant change so consider that a beta version.  Debug log if there are any issues please.

Emby.Notifications.Discord1200.dll.zip

  • Thanks 1
Link to comment
Share on other sites

rechigo

Also, FYI, beta users should be able to run the plugin on the 4.6.0.51+ beta builds now.

Link to comment
Share on other sites

grafxxx
15 hours ago, BillOatman said:

New test version that replaces dictionaries with queues.  Hopefully should not crash and should always send the rich data notifications.  This is a significant change so consider that a beta version.  Debug log if there are any issues please.

Emby.Notifications.Discord1200.dll.zip 54.89 kB · 3 downloads

Testing now and will report back.

Link to comment
Share on other sites

grafxxx

So Server is not crashing anymore, but I don't get any enriched info at all. Before it was crashing and I received Info double (1x enriched & 1x blank). Attached Log with debug

IMG_AA3CF029B2CE-1.jpeg

embyserver.txt

Link to comment
Share on other sites

zeenix
21 hours ago, BillOatman said:

New test version that replaces dictionaries with queues.  Hopefully should not crash and should always send the rich data notifications.  This is a significant change so consider that a beta version.  Debug log if there are any issues please.

Emby.Notifications.Discord1200.dll.zip 54.89 kB · 4 downloads

Work well on 4.6.0.51-beta. Thanks !!

Link to comment
Share on other sites

BillOatman
Posted (edited)

Another test please, trying to get metadata (rich data) back.  It seems, based on comments in the code and what we are seeing, that Emby says the new material is available before it has gotten its metadata.  This attempts to handle it. A debug log even if it works would be helpful as well please.

 

Emby.Notifications.Discord1201.dll.zip

Edited by BillOatman
  • Thanks 2
Link to comment
Share on other sites

BaukeZwart
Posted (edited)

ThiScreenshot_20210523-201906.thumb.jpg.de043f12418047e1a5e5cb5599637cbd.jpg
This was with build 1200.

Edited by BaukeZwart
Link to comment
Share on other sites

grafxxx

Enriched info is back, server not crashing but media info is still doubled (enriched / blank)

Link to comment
Share on other sites

BillOatman
2 hours ago, grafxxx said:

Enriched info is back, server not crashing but media info is still doubled (enriched / blank)

Meaning 2 entries in discord each?  Can you send a debug log please?

Link to comment
Share on other sites

grafxxx
Posted (edited)

I reactivated debug log and add a new movie now. after scan i post the log here. So scan is succesful but for the movie no enriched data and again a double posting in discord. Log is attached. Thank you so much for your support.

IMG_31E886D78501-1.jpeg

embyserver.txt

Edited by grafxxx
Update
Link to comment
Share on other sites

BillOatman
2 hours ago, grafxxx said:

I reactivated debug log and add a new movie now. after scan i post the log here. So scan is succesful but for the movie no enriched data and again a double posting in discord. Log is attached. Thank you so much for your support.

IMG_31E886D78501-1.jpeg

 

Thanks, I think you deleted something which sent it into a tailspin too :)  Try this with debug logging again please.

Emby.Notifications.Discord1202.dll.zip

Link to comment
Share on other sites

grafxxx

Run a scan again and discord picked up the movie but this time just once without enriched data. Really strange.

embyserver.txt

Link to comment
Share on other sites

BillOatman

@grafxxx  Does "Instinct - Gefährliche Begierde (2019)" have metadata from a provider?

Link to comment
Share on other sites

BillOatman
2 hours ago, grafxxx said:

Yes for example moviedb:

https://www.themoviedb.org/movie/530743

Hmmm.  I think I have gone past my ability to work on it without being able to run in the debugger :)

What's in github will have to do until someone who uses this can take the torch :)

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