Jump to content

Correct usage of INotificationManager


jelum
Go to solution Solved by Luke,

Recommended Posts

jelum

Hi,

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

Link to comment
Share on other sites

  • Solution

Hi, you could try this:

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

            _notificationManager.SendNotification(notification);

 

  • Thanks 1
Link to comment
Share on other sites

jelum

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

jelum

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?

Link to comment
Share on other sites

jelum

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 2 weeks later...
jelum

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