Jump to content


Photo

INotificationManager - NotificationRequest wants long integers, but should be GUID?


  • Please log in to reply
8 replies to this topic

#1 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 4443 posts
  • Local time: 06:39 PM
  • LocationPeterborough, Canada

Posted 27 January 2020 - 02:46 PM

In the NotificationRequest class the UserIds param would like an array of long integers. But I'm pretty sure it should be an array of GUID's because User Ids are usually GUIDs. 

 

I think.  @Luke 



#2 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 148690 posts
  • Local time: 06:39 PM

Posted 27 January 2020 - 02:49 PM

No, internally everything is based on the long id's now. Only beyond the borders of the api are the guids used.


  • chef likes this

#3 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 4443 posts
  • Local time: 06:39 PM
  • LocationPeterborough, Canada

Posted 27 January 2020 - 02:53 PM

Nevermind, I think it's the internal Id's... which would satify the condition.



#4 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 4443 posts
  • Local time: 06:39 PM
  • LocationPeterborough, Canada

Posted 27 January 2020 - 02:53 PM

Just read this as you where answering, thank you sir.



#5 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 4443 posts
  • Local time: 06:39 PM
  • LocationPeterborough, Canada

Posted 27 January 2020 - 03:41 PM

Slightly confused here sir.

 

1. I have created my NotificationFactory class which has created the Notification options in the server. I have Enabled this notification.

        public IEnumerable<NotificationTypeInfo> GetNotificationTypes()
        {
           return new List<NotificationTypeInfo>
            {
                new NotificationTypeInfo
                {
                    Type = "foofoo",
                    Name = "fooBar",
                    Category = "System", //By the way this will not place the notification under System - it creates a new System heading
                    Enabled = true,
                    IsBasedOnUserEvent = false
                }
            };
           
        }

2. I have a scheduled task which runs once a day, and will trigger a notification like this:

            var request = new NotificationRequest()
            {
                Date = DateTimeOffset.Now,
                Description = "foo",
                Level = NotificationLevel.Warning,
                Name = "fooBar",
                NotificationType = "foofoo",
                SendToUserMode = SendToUserType.Admins,
                Url = "", //Is this an imageUrl or a link to more information? It's an empty url right now...
                UserIds = UserManager.Users.Where(i => i.Policy.IsAdministrator).Select(i => i.InternalId).ToArray()
            };

            await NotificationManager.SendNotification(request, CancellationToken.None).ConfigureAwait(false); 

My question is, what does the notification look like? is it the rectangle that is suppose to appear in the right corner of the browser?  

 

I just don;t see anything happen when I run the task, but I'm also not sure what I'm look for.

 

Thank you sir.

 

@Luke



#6 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 148690 posts
  • Local time: 06:39 PM

Posted 27 January 2020 - 03:46 PM

No, it's the notification outputs that are enabled in server settings.



#7 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 4443 posts
  • Local time: 06:39 PM
  • LocationPeterborough, Canada

Posted 27 January 2020 - 06:46 PM

I don't think I'm going completely crazy...

 

The emby wiki notifications section mentions one  built in notification system (https://support.emby...9-notifications) which might have been available on an older version of the server, but is not available anymore?

 

for piece of mind, the notifications (once setup) can only work with plugins (email pushalot etc..). There currently is no internal notification system, and we aren't (necessarily) able to access the Alert List on the dashboard? 



#8 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 148690 posts
  • Local time: 06:39 PM

Posted 27 January 2020 - 06:51 PM

There's no built-in notification output.



#9 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 4443 posts
  • Local time: 06:39 PM
  • LocationPeterborough, Canada

Posted 27 January 2020 - 06:56 PM

Thank you.

 

5e2f6a846d178_siliconvalley2.jpg


  • CBers and Dibbes like this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users