Jump to content

Channel of Tv Shows


bakes82

Recommended Posts

bakes82

@LukeHow do we create collections?  Is the collection manager no longer the valid way?  It takes a long userId, but I dont see a "long" userid just the guid, there is no longId like some of the other objects.  Also I have the "libraryId" where would that go, Id assume collections are per library.

 

var createdCollection = await _collectionManager.CreateCollection(new CollectionCreationOptions
                                                                  {
                                                                      Name     = collection.CollectionName,
                                                                      ItemIdList = foundMovies.ToArray(),
                                                                      //UserIds = new []{ 3 }   //This is array of long, but the restapi uses the GUID
                                                                  });

if (createdCollection == null)
{
    _logger.Error("created collections null");  //Its always null
}

collection.CollectionId = createdCollection.InternalId;
Link to comment
Share on other sites

bakes82
28 minutes ago, Luke said:

The long id that it’s expecting is InternalID. Collections are not per library.

So how does it work when you split libraries by quality?  Is it auto intelligent to know, or is it going to show duplicate entries?  Also it seems when you make one from the UI, it only ever shows for the library it was created under, or its it based on the ids of the items added, so if I only pull xx items from xx library it will only ever show on the library?

Link to comment
Share on other sites

Whether you see duplicates or not depends on whether the two items are merged together in the server or not. And if they’re not, then it depends on whether both are added to the collection or not.

Link to comment
Share on other sites

bakes82
10 minutes ago, Luke said:

Whether you see duplicates or not depends on whether the two items are merged together in the server or not. And if they’re not, then it depends on whether both are added to the collection or not.

So my logic is correct?  It only shows on the library of the items it contains in the list of Ids in the collection?

So if I filter this to where libraryId = 4 (movies animations), it will only show on that library?

Also whats the filter for libraryId?  I thought parentId, but should I be using the Guid of the getvirtualfolders. This is where having basic getters for "LibraryId" and what the UI objects are called makes it far easier to work with than trying to figure out if the GUID of the ParentId, maps to the field called GUID but is a string..... 

var mediaItems = _libraryManager.GetItemList(new InternalItemsQuery
                                            {
                                                IncludeItemTypes = new[]
                                                                   {
                                                                       nameof(Movie)
                                                                   },
                                                IsVirtualItem = false,
                                                OrderBy = new[]
                                                          {
                                                              new ValueTuple<string, SortOrder>(ItemSortBy.PremiereDate, SortOrder.Descending),
                                                              new ValueTuple<string, SortOrder>(ItemSortBy.SeriesSortNameOrSortName, SortOrder.Ascending)
                                                          }
                                            })
                               .ToList();

 

 

var libraries = libraryManager.GetVirtualFolders();
foreach (var virtualFolderInfo in libraries)
{
    list.Add(new EditorSelectOption
             {
                 Value     = virtualFolderInfo.Id,
                 Name      = virtualFolderInfo.Name,
                 IsEnabled = true,
                 ShortName = virtualFolderInfo.Name,
                 ToolTip = virtualFolderInfo.Name
             });
}
Link to comment
Share on other sites

They're strings to match the api. Generally speaking, for the most part, Guid is no longer used internally so everything should be based on InternalId.

Try using ParentIds.

Link to comment
Share on other sites

bakes82
19 minutes ago, Luke said:

They're strings to match the api. Generally speaking, for the most part, Guid is no longer used internally so everything should be based on InternalId.

Try using ParentIds.

My question is how do I filter the media by "LibraryId" in the GetItemsList.  The Ids I get are 4, and 450 from the GetVirtualFolder output Ids,  These appear to be +1 from the ParentId on the media items.

2023-10-01 20:02:06.400 Info App: LibraryId TO Find = 4
2023-10-01 20:02:06.401 Info App: Media record = 3 , 3

_logger.Info($"LibraryId TO Find = {collection.LibraryId}");
_logger.Info($"Media record = {movie.ParentId} , {movie.GetTopParent().InternalId}");
Link to comment
Share on other sites

Try using what you have for LibraryId in ParentIds of a filter. You don't need to use GetVirtuaFolder to find the raw folder ids.

Link to comment
Share on other sites

bakes82
14 minutes ago, Luke said:

Try using what you have for LibraryId in ParentIds of a filter. You don't need to use GetVirtuaFolder to find the raw folder ids.

Im not using it to get the IDs, I have a drop down of Libraries, the selected library Id for the one I have stored is "4".  When I loop all the media, the parent/gettopparent.internalId is 3. So its like the Id of the library is +1.  If I set the filter to 4, no media is returned.  So my question is how do I show a list of libraries, get the Id, then get the list of media associated with that library.

does this help?

The GetVirtualFolder shows me the 4, all the movies are associated with the 3.
image.png.ec88a5a6db944a152784542356c6718f.png
image.png.0e248cbaee9fcc68ae95042061d095b0.png

Link to comment
Share on other sites

We'd have to look at code examples of your queries, but using the parentId of 4 should work just fine. Even though it's not the physical parent in the database, that's OK. The server translate it.

Link to comment
Share on other sites

bakes82
9 minutes ago, Luke said:

We'd have to look at code examples of your queries, but using the parentId of 4 should work just fine. Even though it's not the physical parent in the database, that's OK. The server translate it.

I guess I was getting confused because when you see the parentId in the logs of the items its showing 3 so I was trying to validate that the query is correct as in my loop I was doing a double check on the parentid and they werent matching.

How would I delete a collection?  The manager only has add/remove items, and I assume for my use case its just easier to recreate it each time than trying to manage what was added/deleted

Link to comment
Share on other sites

2 minutes ago, bakes82 said:

I guess I was getting confused because when you see the parentId in the logs of the items its showing 3 so I was trying to validate that the query is correct as in my loop I was doing a double check on the parentid and they werent matching.

How would I delete a collection?  The manager only has add/remove items, and I assume for my use case its just easier to recreate it each time than trying to manage what was added/deleted

You can delete with the normal librarymanager.deleteitem

Link to comment
Share on other sites

bakes82

@softworkzIs there a way to push a button to the right side?

 

public ButtonItem Delete =>
    new ButtonItem
    {
        Icon    = IconNames.delete_forever,
        Caption = "Delete",
        Data1   = "DeleteCollection",
        Data2 = Id.ToString(),
        ConfirmationPrompt  = "Are you sure?"
    };

If I do it this way its aligned right but it has the list background, is there a way to disable that?

public GenericItemList Button =>
    new GenericItemList
    {
        new GenericListItem
        {
            
            Button1 = new ButtonItem
                      {
                          Icon               = IconNames.delete_forever,
                          Caption            = "Delete",
                          Data1              = "DeleteCollection",
                          Data2              = Id.ToString(),
                          ConfirmationPrompt = "Are you sure?"
                      }
        }
    };

 

image.png.d7f83a5a725e88feb0e9282e3e724322.png

This is what I would like to do:
image.png.c9fe583195f7d9a1511a5ad63373aaba.png

Link to comment
Share on other sites

bakes82

@LukeAre we able to set an order of the items?  I thought just setting order of the items in the array would do it, but it doesnt seem to be. Also when I change the sort order of "Collection Order" it doesnt change the order of the items, but if I use a collection that was made from the UI it does change the order.  It appears to me like the "Collection Order" is the release date order ASC

 

var createdCollection = await _collectionManager.CreateCollection(new CollectionCreationOptions
                                                                  {
                                                                      Name       = collection.CollectionName,
                                                                      ItemIdList = foundItems.ToArray(),
                                                                      UserIds = new[]
                                                                                {
                                                                                    adminUser.InternalId
                                                                                }
                                                                  });
Link to comment
Share on other sites

10 hours ago, bakes82 said:

@softworkzIs there a way to push a button to the right side?

It's not quite clear to me what you are trying to accomplish. If the Delete button is supposed to delete the list item, then it should be inside that item.

Here's an example:

image.png.233ead27f2406ebe3d6d68d11c80ae47.png

 

Link to comment
Share on other sites

bakes82
2 hours ago, softworkz said:

It's not quite clear to me what you are trying to accomplish. If the Delete button is supposed to delete the list item, then it should be inside that item.

I want to be able to set the position of a button to either be on the left or the right.  It looks like if you add button 1 in a List Item its on the right, but a list item doesnt seem to let you add other components.  If you just add a button not in a list item then, its default position is left aligned, I want it to be right aligned..  Would also be great not to have the extra gap where the "CaptionItem Title goes" if its null/empty since there is also a editor title.  Also a nice to have would be able to have a divider like a HR

 

image.png.da6b7f5df130f0a5e6ff158f6397beb1.png

 

image.png.ae6a6780eec369707f325c82ddc24e28.png

Link to comment
Share on other sites

1 hour ago, bakes82 said:

I want to be able to set the position of a button to either be on the left or the right.

This is currently not possible. I'm not sure whether we should allow this either, will have to think about it a little.

1 hour ago, bakes82 said:

 It looks like if you add button 1 in a List Item its on the right, but a list item doesnt seem to let you add other components. 

You can add an icon, two text parts, two buttons and a a toggle button, but no arbitrary components.

1 hour ago, bakes82 said:

Would also be great not to have the extra gap where the "CaptionItem Title goes" if its null/empty since there is also a editor title.  Also a nice to have would be able to have a divider like a HR

Thanks for the screenshot, I understand the situation now and I think the approach with the editor repetition is not ideal for your case for multiple reasons:

  • It's not visually appealing and neither intuitive
    It can be difficult to understand that there a multiple repetitive sections which can be added or removed
    That's why you are asking for a divider
  • Having all properties of a section editable at all times is probably not intended/desirable
    this would impose complexity to your operational implementation; you would always need to check what was changed and whether you would need to re-create the channel to accommodate for these changes
  • Often, there are some parts of a configuration which are fixed and some which may be changed later
    (of course sometimes it's only this or that)
    Of course it's possible to make the immutable property controls disabled once added, but...:

I would rather recommend a different approach - which is kind of the "blueprint pattern" for such cases and used in several upcoming plugins. You can already see this in the "Transcoding Test" plugin:

  • The "configured items" are shown in a list  as list items (with or without subitems and buttons)
  • Adding items is done through a wizard
    This provides a number of opportunities which can't be done with a plain and direct configuration:
    • The individual settings can be explained better
    • It goes step-by-step, which allows to guide the user and show only those settings which are applicable - based on settings made in a previous step
    • You can validate settings before allowing to proceed
    • You can load data for selection based on settings made in a previous step
  • It provides a clear logic to the user about how configuration items are added, changed and removed
  • etc..

 

Here's an example:

 

 

Link to comment
Share on other sites

bakes82

@softworkzWheres the code for the transcode test thing?  While your wizard thing is nice, its also overkill for my use case of just adding a collection name/id and setting a couple drop downs, it would all be done on one frame.  So having a divider would make more sense to me as I have a "add new" button that adds a new collection.  The add new could also just be a popup and the data below could be a listview sure, but I havent seen a sample of that IDT.  Im also recreating the collections via a schedule task and it delete the existing collection and makes new every time since well the lists are dynamic no point trying to remove existing items/add new when start from fresh is way faster and less api calls.  So while you have good insight on how things should work you also havent published any guides and it seems very cumbersome, have you ever worked with like telerik/devexpress controls?  A good portion of some of the plugins could just be a simple "Grid" with a add/delete row option since the options are just being configured for background task.

 

This is basically what I need for the majority of the plugins Im thinking of:
image.png.79588d7dfc90a4cb3a77a7e02f416eec.png
https://demos.devexpress.com/blazor/Grid/EditData/EditForms

Link to comment
Share on other sites

5 minutes ago, bakes82 said:

@softworkzWheres the code for the transcode test thing?  While your wizard thing is nice, its also overkill for my use case of just adding a collection name/id and setting a couple drop downs, it would all be done on one frame.

There's nothing against a 1-step wizard. You could also use a dialog of course.

 

6 minutes ago, bakes82 said:

So having a divider would make more sense to me

It makes sense to me to have a divider element. It could quickly be added as a GenericEdit item, but we'll have to see what @Lukewill say and whether he wants to have such element.

 

8 minutes ago, bakes82 said:

Wheres the code for the transcode test thing?

9 minutes ago, bakes82 said:

So while you have good insight on how things should work you also havent published any guides and it seems very cumbersome,

I'm thinking about creating another plugin example, demonstrating dialogs and wizards, because that's in fact still missing. I can try to get this done quickly if you're interested.

 

10 minutes ago, bakes82 said:

have you ever worked with like telerik/devexpress controls? 

I'm even affiliated with DevExpress in some way. I know their controls very well (WinForms controls even inside out).

 

10 minutes ago, bakes82 said:

A good portion of some of the plugins could just be a simple "Grid" with a add/delete row option since the options are just being configured for background task.

The grid with the checkboxes in the video is the DevExpress grid.

Please see EditorDxGrid

Though, there's no sample code available yet.

Link to comment
Share on other sites

bakes82
35 minutes ago, softworkz said:

There's nothing against a 1-step wizard. You could also use a dialog of course.

 

It makes sense to me to have a divider element. It could quickly be added as a GenericEdit item, but we'll have to see what @Lukewill say and whether he wants to have such element.

 

I'm thinking about creating another plugin example, demonstrating dialogs and wizards, because that's in fact still missing. I can try to get this done quickly if you're interested.

 

I'm even affiliated with DevExpress in some way. I know their controls very well (WinForms controls even inside out).

 

The grid with the checkboxes in the video is the DevExpress grid.

Please see EditorDxGrid

Though, there's no sample code available yet.

Does the grid allow for editing, you just show a read version ;).  Id take a grid/list view with dialog form entry example :P , you could probably do it w/out a popup just have the form above the grid, on save, clear form, add row, but popup might help more people also

Link to comment
Share on other sites

I don't have a video showing editing at hand right now, but here's a recent feature demo. It's actually about grid extensions to make it operable in a TV situation via remove control, but it shows a lot of the available features (not editing unfortunately).

 

 
Link to comment
Share on other sites

bakes82
On 10/2/2023 at 4:32 PM, softworkz said:

I don't have a video showing editing at hand right now, but here's a recent feature demo. It's actually about grid extensions to make it operable in a TV situation via remove control, but it shows a lot of the available features (not editing unfortunately).

 

 

So did you get that demo on how to use the popup/wizard thing?

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