Jump to content

Correct usage of INotificationManager


Go to solution Solved by Luke,

Recommended Posts

Posted

Hi,

Where can I find correct usage examples of INotificationManager? I want to notify a user about problems with a token

  • Solution
Posted

Hi, you could try this:

            var notification = new NotificationRequest
            {
                Date = DateTimeOffset.UtcNow,
                Description = "My description",
                Title = "My Title"
            };

            _notificationManager.SendNotification(notification);

 

  • Thanks 1
Posted

How the user will know that the notification came from my plugin?

Posted
1 hour ago, jelum said:

How the user will know that the notification came from my plugin?

You'll have to use the title and description as best you can to accomplish that.

  • Thanks 1
Posted

I was not able to find any documentation about MediaBrowser.Controller.Entities.InternalItemsQuery object and namely property Recursive. What item is Recursive? Series, since it may have folders for seasons inside. Is it somehow applicable to Movies or other item types with simple structure (only one file)?

Can you please explain it, point to documentation, or share it?

Posted

What are you trying to do?

Posted

I want to find:

1. all libraries with type Movie, Series, Mixed

libraryManager.QueryItems(new InternalItemsQuery
{
    IncludeItemTypes = new[] { nameof(CollectionFolder),nameof(BoxSet) },
    Recursive = false,
    HasPath = true,
    IsFolder = true,
    IsVirtualItem = false
});

2. all collections with a specific name

libraryManager.QueryItems(new InternalItemsQuery
{
    IncludeItemTypes = new[] { nameof(BoxSet) },
    Recursive = false,
    Name = collectionName
});

3. Movies and Series from a specific Library having specific Provider IDs

return libraryManager.QueryItems(new InternalItemsQuery
{
    IncludeItemTypes = new[] { nameof(Movie), nameof(Series) },
    AnyProviderIdEquals = providerIdList,
    Recursive = false,
    IsVirtualItem = false,
    ParentIds = librariesIds,
    HasPath = true
});

4. Same as 3, but from all Libraries, so I removed 'ParentIds' property.

Posted

Your queries for #2, #3 and #4 all look good, but just change Recursive to true.

Posted

For #1, just remove boxset as one of the types you're requesting and then I think it should work.

Posted

@jelumplease let us know how this goes. Thanks.

  • Agree 1
  • 2 weeks later...
Posted

@Lukelooks like it does what it has to do. I'll update you in case will find any strange behavior. Thanks for the help once again

  • Thanks 1

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