Jump to content


Photo

New Plugin: Discord Notifications


  • Please log in to reply
176 replies to this topic

#161 thunderstorm456 OFFLINE  

thunderstorm456

    Newbie

  • Members
  • 1 posts
  • Local time: 03:37 PM

Posted 22 May 2020 - 08:25 AM

Just wanted to say thanks to @rechigo for this awesome plugin which I only discovered today. It does everything I was looking for and works brilliantly! Thanks for all your hard work, awesome effort!


  • rechigo likes this

#162 RobinM OFFLINE  

RobinM

    Member

  • Members
  • 23 posts
  • Local time: 04:37 PM

Posted 24 May 2020 - 04:30 AM

Since the last Emby beta, the notifications are not getting send anymore, at least not for me. Will reboot the server to see if it helps, will generate a debug if rebooting did not help :)



#163 jsflix OFFLINE  

jsflix

    Newbie

  • Members
  • 8 posts
  • Local time: 04:37 PM

Posted 24 May 2020 - 12:23 PM

My notifications are also not getting send.



#164 rechigo OFFLINE  

rechigo

    Advanced Member

  • Members
  • 775 posts
  • Local time: 07:37 AM
  • LocationCALIFORNIA

Posted 24 May 2020 - 01:22 PM

I will looks

Sent from my Galaxy S10

#165 rechigo OFFLINE  

rechigo

    Advanced Member

  • Members
  • 775 posts
  • Local time: 07:37 AM
  • LocationCALIFORNIA

Posted 24 May 2020 - 02:11 PM

Ok guys I am not able to recreate this, tried with TV and Movies on 4.5.0.11

 

Some logs and some details on your plugin configuration will help to debug this



#166 jsflix OFFLINE  

jsflix

    Newbie

  • Members
  • 8 posts
  • Local time: 04:37 PM

Posted 26 May 2020 - 04:12 AM

I am running Emby 4.4.2.0 on a Synology NAS. Thats the Emby Package that they prepared for the Synology Package Manager.

 

I have multiple Users that are configured with Webhooks. Two don't use the enriched notifications, as they send the messages of the plugin Playback Reporting.

For now I have another user 'new_movies' that should send enriched notifications for movies.

 

This is the only error I see in the logs when adding new movies:

2020-05-26 10:10:07.876 Error App: Error in ItemAdded event handler
	*** Error Report ***
	Version: 4.4.2.0
	Command line: /var/packages/EmbyServer/target/server/EmbyServer.exe -package synology -programdata /var/packages/EmbyServer/target/var -ffmpeg /var/packages/EmbyServer/target/ffmpeg/bin/ffmpeg -ffprobe /var/packages/EmbyServer/target/ffmpeg/bin/ffprobe -ffdetect /var/packages/EmbyServer/target/ffmpeg/bin/ffdetect -restartexitcode 121
	Operating system: Unix 4.4.59.0
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: False
	Mono: 6.8.0.105 (tarball Sun Apr  5 17:28:17 UTC 2020)
	Runtime: file:///volume1/@appstore/EmbyServer/3rdparty/mono/6.8.0.105/lib/mono/4.5/mscorlib.dll
	System.Environment.Version: 4.0.30319.42000
	Processor count: 2
	Program data path: /var/packages/EmbyServer/target/var
	Application directory: /volume1/@appstore/EmbyServer/releases/4.4.2.0
	System.NullReferenceException: System.NullReferenceException: Object reference not set to an instance of an object
	  at Emby.Server.Implementations.Library.UserManager.GetInternalId (System.Guid id) [0x00007] in <3605319732a64e8282cfdf09a091f02e>:0 
	  at Emby.Notifications.Discord.Notifier.isInVisibleLibrary (System.String UserId, MediaBrowser.Controller.Entities.BaseItem item) [0x0002d] in <e3ac83fbfa784f9ca44026146649592f>:0 
	  at Emby.Notifications.Discord.Notifier+<>c__DisplayClass17_0.<ItemAddHandler>b__0 (Emby.Notifications.Discord.Configuration.DiscordOptions options) [0x000eb] in <e3ac83fbfa784f9ca44026146649592f>:0 
	  at System.Collections.Generic.List`1[T].ForEach (System.Action`1[T] action) [0x0001e] in <9d3f0d4bd0fb4c1e8b6c2ac1ba1303ac>:0 
	  at Emby.Notifications.Discord.Notifier.ItemAddHandler (System.Object sender, MediaBrowser.Controller.Library.ItemChangeEventArgs changeEvent) [0x00044] in <e3ac83fbfa784f9ca44026146649592f>:0 
	  at (wrapper delegate-invoke) System.EventHandler`1[MediaBrowser.Controller.Library.ItemChangeEventArgs].invoke_void_object_TEventArgs(object,MediaBrowser.Controller.Library.ItemChangeEventArgs)
	  at Emby.Server.Implementations.Library.LibraryManager.CreateItems (System.Collections.Generic.List`1[T] items, MediaBrowser.Controller.Entities.BaseItem parent, System.Threading.CancellationToken cancellationToken) [0x00054] in <3605319732a64e8282cfdf09a091f02e>:0 
	Source: Emby.Server.Implementations
	TargetSite: Int64 GetInternalId(System.Guid)

Edited by jsflix, 26 May 2020 - 06:49 AM.


#167 jsflix OFFLINE  

jsflix

    Newbie

  • Members
  • 8 posts
  • Local time: 04:37 PM

Posted 27 May 2020 - 03:35 AM

I have another error message.
Half an hour ago I should have gotten a message from Playback Reporting with all the content watched since yesterday.
Looking into the logs reveals this error message:

 

2020-05-27 09:00:00.031 Info UserActivityReportNotification - TaskNotifictionReport: Activity Query : SELECT UserId, ItemType, ItemName, SUM(PlayDuration - PauseDuration) AS PlayTime FROM PlaybackActivity WHERE DateCreated > '2020-05-26 09:00:00.229616' GROUP BY UserId, ItemType, ItemName
2020-05-27 09:00:00.073 Info UserActivityReportNotification - TaskNotifictionReport: Default journal_mode for /var/packages/EmbyServer/target/var/data/playback_reporting.db is delete
2020-05-27 09:00:00.301 Info UserActivityReportNotification - TaskNotifictionReport: Cutoff DateTime for new items - date: 2020-05-26 09:00:00.229616 ago: 1.00:00:00.0717950
2020-05-27 09:00:00.301 Info UserActivityReportNotification - TaskNotifictionReport: User activity Message : ItemCount : 22
User activity since last check 1 day ago.

user1
 - (Episode) Killing Eve - s03e07 - Beautiful Monster (00:41:18)
 - (Episode) One Piece - s19e37 - The History of the Left Eye! Pedro vs. Baron Tamago (00:20:22)
 - (Episode) One Piece - s19e38 - Moist Cigarette! The Night Before Sanji's Wedding! (00:20:06)
 - (Episode) One Piece - s19e39 - The Undaunted Soul! Brook vs. Big Mom! (00:19:11)
 - (Episode) Snowpiercer - s01e02 - Prepare to Brace (00:45:08)
 - (Episode) Veep - s02e07 - Shutdown (00:26:56)
 - (Episode) World Trigger - s01e06 - Chika Amatori's Side Effect (00:00:00)

user2
 - (Episode) One Piece - s21e18 - Mysterious Grave Markers! A Reunion at the Ruins of Oden Castle! (00:22:00)
 - (Episode) One Piece - s21e19 - A Legendary Samurai! The Man Who Roger Admired! (00:20:47)
 - (Episode) One Piece - s21e20 - Bringing Down the Emperor of the Sea! A Secret Raid Operation Begins! (00:39:54)
 - (Episode) One Piece - s21e21 - The Strongest Man in the World! Shutenmaru, the Thieves Brigade Chief! (00:47:25)
 - (Episode) One Piece - s21e22 - Everyone is Annihilated! Kaido's Furious Blast Breath! (00:44:17)
 - (Episode) One Piece - s21e23 - Finally Clashing! The Ferocious Luffy vs. Kaido! (00:44:40)
 - (Episode) One Piece - s21e24 - Destructive! One Shot, One Kill: Thunder Bagua! (00:46:33)
 - (Episode) One Piece - s21e25 - A Living Hell! Luffy, Humiliated in the Great Mine! (00:46:53)
 - (Episode) One Piece - s21e26 - The Holyland in Tumult! Emperor of the Sea Blackbeard Cackles! (00:29:43)
 - (Episode) One Piece - s21e27 - It's On! The Special Operation to Bring Down Kaido! (00:21:18)
 - (Episode) One Piece - s21e28 - Rampage! The Prisoners: Luffy and Kid! (00:23:50)
 - (Episode) One Piece - s21e29 - A Great Sensation! Sanji's Special Soba! (00:26:42)
 - (Episode) One Piece - s21e30 - Luxurious and Gorgeous! Wano's Most Beautiful Woman: Komurasaki! (00:11:02)

user3
 - (Episode) Elementary - s04e20 - Art Imitates Art (00:43:49)
 - (Episode) Elementary - s04e21 - Ain't Nothing Like the Real Thing (00:42:43)


2020-05-27 09:00:00.783 Error Emby.Notifications.Discord: Failed to execute webhook: 
	*** Error Report ***
	Version: 4.4.2.0
	Command line: /var/packages/EmbyServer/target/server/EmbyServer.exe -package synology -programdata /var/packages/EmbyServer/target/var -ffmpeg /var/packages/EmbyServer/target/ffmpeg/bin/ffmpeg -ffprobe /var/packages/EmbyServer/target/ffmpeg/bin/ffprobe -ffdetect /var/packages/EmbyServer/target/ffmpeg/bin/ffdetect -restartexitcode 121
	Operating system: Unix 4.4.59.0
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: False
	Mono: 6.8.0.105 (tarball Sun Apr  5 17:28:17 UTC 2020)
	Runtime: file:///volume1/@appstore/EmbyServer/3rdparty/mono/6.8.0.105/lib/mono/4.5/mscorlib.dll
	System.Environment.Version: 4.0.30319.42000
	Processor count: 2
	Program data path: /var/packages/EmbyServer/target/var
	Application directory: /volume1/@appstore/EmbyServer/releases/4.4.2.0
	System.Net.WebException: System.Net.WebException: The remote server returned an error: (400) Bad Request.
	  at System.Net.HttpWebRequest.GetResponseFromData (System.Net.WebResponseStream stream, System.Threading.CancellationToken cancellationToken) [0x00146] in <b373cc92cfb94ef6a19b4f1140645494>:0 
	  at System.Net.HttpWebRequest.RunWithTimeoutWorker[T] (System.Threading.Tasks.Task`1[TResult] workerTask, System.Int32 timeout, System.Action abort, System.Func`1[TResult] aborted, System.Threading.CancellationTokenSource cts) [0x000f8] in <b373cc92cfb94ef6a19b4f1140645494>:0 
	  at System.Net.HttpWebRequest.EndGetResponse (System.IAsyncResult asyncResult) [0x00020] in <b373cc92cfb94ef6a19b4f1140645494>:0 
	  at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func`2[T,TResult] endFunction, System.Action`1[T] endAction, System.Threading.Tasks.Task`1[TResult] promise, System.Boolean requiresSynchronization) [0x0000f] in <9d3f0d4bd0fb4c1e8b6c2ac1ba1303ac>:0 
	--- End of stack trace from previous location where exception was thrown ---
	
	  at Emby.Notifications.Discord.DiscordWebhookHelper.ExecuteWebhook (Emby.Notifications.Discord.DiscordMessage message, System.String webhookUrl, MediaBrowser.Model.Serialization.IJsonSerializer _jsonSerializer) [0x0018b] in <e3ac83fbfa784f9ca44026146649592f>:0 
	  at Emby.Notifications.Discord.Notifier.QueuedMessageSender (System.Object sender, System.Timers.ElapsedEventArgs eventArgs) [0x000e6] in <e3ac83fbfa784f9ca44026146649592f>:0 
	Source: mscorlib
	TargetSite: Void Throw()

This error message repeats itself multiple times per second and until now.
I think restarting my NAS fixes this.

EDIT:
After a restart of my NAS the notification works again and there are no error messages.

 

EDIT2:
After adding another movie the error message of my previous message comes up again and I dont get an enriched notification.


Edited by jsflix, 27 May 2020 - 03:59 AM.


#168 yasuno OFFLINE  

yasuno

    Member

  • Members
  • 18 posts
  • Local time: 09:37 AM

Posted 27 May 2020 - 10:27 PM

Just want to comment that is has been working for me for a few days now, thanks for making this!


  • rechigo likes this

#169 rechigo OFFLINE  

rechigo

    Advanced Member

  • Members
  • 775 posts
  • Local time: 07:37 AM
  • LocationCALIFORNIA

Posted 28 May 2020 - 08:28 PM

Sorry jsflix, I have been busy for the last couple of days

 

The second error you have posted comes from a malformed webhook payload sent to discord. It's difficult to tell what caused it without looking at what data was sent to discord

 

The second error looks to stem from the item visibility checker (it determines whether or not user has access to a specific library, and if it does it will send the notification, if not, it will ignore it)

 

Let me know if this is still happening



#170 koelner21 OFFLINE  

koelner21

    Advanced Member

  • Members
  • 64 posts
  • Local time: 04:37 PM

Posted 29 May 2020 - 08:10 AM

Hello,
 
is there a manual somewhere how to install the addon? I have a Synology NAS. 


#171 jsflix OFFLINE  

jsflix

    Newbie

  • Members
  • 8 posts
  • Local time: 04:37 PM

Posted 29 May 2020 - 01:16 PM

Sorry jsflix, I have been busy for the last couple of days

 

The second error you have posted comes from a malformed webhook payload sent to discord. It's difficult to tell what caused it without looking at what data was sent to discord

 

The second error looks to stem from the item visibility checker (it determines whether or not user has access to a specific library, and if it does it will send the notification, if not, it will ignore it)

 

Let me know if this is still happening

No worries! Thank you for your answer. As is I am totally happy with your work and if youre busy then I have to live without the extra notifications. No big deal for me! :)

My message users were indeed deactivated and had no access to my libraries.

I reactivated the new_movies user and gave him access to my movie library.

Unfortunately there are still no messages.

Do you know how I would get the malformed webhook payload to show up in my logs to show to you?



#172 jsflix OFFLINE  

jsflix

    Newbie

  • Members
  • 8 posts
  • Local time: 04:37 PM

Posted 29 May 2020 - 01:23 PM

 

Hello,
 
is there a manual somewhere how to install the addon? I have a Synology NAS. 

 

Are you using the Emby Package from the package center?
Because if you do you should be able to recreate my work flow for this.
I download the newest version on my pc and copy it to my shared media folder.

Then i tunnel into the NAS with an SSH connection via Putty using the credentials of my Synology user copying the Emby.Discord.Notification.dll to the plugins folder.
The plugins folder is located at '/volume1/@appstore/EmbyServer/var/plugins'.

After copying the dll-file I use chown embysvr and chmod 644 to give the needed rights.

A quick restart of Emby and then you can use the plugin.

 

If you need further assistance shoot me a private message :)



#173 koelner21 OFFLINE  

koelner21

    Advanced Member

  • Members
  • 64 posts
  • Local time: 04:37 PM

Posted 29 May 2020 - 01:44 PM

I put the dll in the Folder: 

 

/volume1/Festplatte 1/Emby.Notifications.Discord.dll

 

then i open cmd on Windows and type

ssh admin@IP

Passwort

 

sudo-i ?



#174 jsflix OFFLINE  

jsflix

    Newbie

  • Members
  • 8 posts
  • Local time: 04:37 PM

Posted 29 May 2020 - 03:34 PM

Moving this to private messages



#175 koelner21 OFFLINE  

koelner21

    Advanced Member

  • Members
  • 64 posts
  • Local time: 04:37 PM

Posted 29 May 2020 - 04:25 PM

@jsflix Nochmal Vielen Dank für deine Hilfe... absolute Spitzenklasse..



#176 rechigo OFFLINE  

rechigo

    Advanced Member

  • Members
  • 775 posts
  • Local time: 07:37 AM
  • LocationCALIFORNIA

Posted 29 May 2020 - 04:44 PM

You used to be able to just enable debug logging, but it looks like I must have accidentally cleaned up a ton of useful debug logging messages

I'll add them back and send you the dll over private messages in a bit

Sent from my Galaxy S10

Edited by rechigo, 29 May 2020 - 04:45 PM.

  • jsflix likes this

#177 rechigo OFFLINE  

rechigo

    Advanced Member

  • Members
  • 775 posts
  • Local time: 07:37 AM
  • LocationCALIFORNIA

Posted Yesterday, 11:30 PM

PMed enhanced debug logging build to you @jsflix


  • jsflix likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users