Author Topic: Github for plugin  (Read 3940 times)

0 Members and 1 Guest are viewing this topic.

boutzo

  • Jr. Member
  • **
  • Posts: 24
  • Karma: 0
    • View Profile
Github for plugin
« on: February 18, 2015, 10:59:18 AM »
Is there a github or source code available for the MB3 plugin ?  I just wanted to see if I could expand on some of the command functionality for personal use.  I've tinkered around in the past with the previous incarnation of MB Classic using eventghost, but that was with there old api and a bit of a hassle.

On a side note when the movie xml is being generated, it does not grab the movies in a collection folder, just gets the collection folder itself not the movies inside.  Apparently there is a parameter in there api called CollapseBoxSetItems.  Either its not set or its set to true.

This is just one of the things I wanted to "tinker with".

Great job on what you have so far.

Boutzo

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Github for plugin
« Reply #1 on: February 18, 2015, 03:25:39 PM »
On a side note when the movie xml is being generated, it does not grab the movies in a collection folder, just gets the collection folder itself not the movies inside. 

I don't have this issue with my collection items. All movie titles in my collections exist in my movies media folder and therefore are listed in the movies.xml; I do not see any collection/boxset names in my movies.xml. Out of curiosity, do you see anything notable/unusual when you use the plugin's explorer window to browse your collections (click "Explore" button in the plugin) ?

Mine show up as per the attached image.
« Last Edit: February 18, 2015, 04:48:53 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Github for plugin
« Reply #2 on: February 18, 2015, 04:15:27 PM »
GenXML does not yet generate anything for those types of collections.  The node in the exploration tree that corresponds to the movies.xml is shown here.

I'm pretty sure I'm doing it correctly.  I will try to post the pertinent code when I have time.

boutzo

  • Jr. Member
  • **
  • Posts: 24
  • Karma: 0
    • View Profile
Re: Github for plugin
« Reply #3 on: February 18, 2015, 05:04:03 PM »
@nime5ter

For example Ghostbusters movies are in folders called "Ghostbusters (1984)" and "Ghostbusters (1989)" which are inside a folder called "Ghostbusters Collection".  The xml as well as the explorer just processes "Ghostbusters Collection" nothing inside the folders.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Github for plugin
« Reply #4 on: February 18, 2015, 05:29:12 PM »
GenXML is simply asking the server for all items of type "Movie".  If it is giving back the names of collections then my best guess is that there is either a problem with your MB server or with the way you have organized your media.  Here is the code that requests items:

Code: [Select]
  private async Task<Int32> genXMLItemOfType(String strType,String strFile, int limit = 6000)
        {
            log("generating xml for type: "+ strType);
            ItemQuery iq = new ItemQuery
            {
                UserId = _uid,
                SortBy = new[] { ItemSortBy.SortName },
                SortOrder = MediaBrowser.Model.Entities.SortOrder.Ascending,
                IncludeItemTypes = new[] { strType },
                Limit = limit,
                // Search recursively through the user's library
                Recursive = true
            };
            var items = await _client.GetItemsAsync(iq);

            log("analyzing result for: "+strType+ ", with count "+items.Items.Count());
            Dictionary<String, String> dictItems = new Dictionary<string, string>();
            foreach (var foo in items.Items)
            {
                dictItems.Add(foo.Id, foo.Name);
            }
            log("Saved "+dictItems.Count+" items of type: " + strType);
            _host.savePayloadFile(strFile, dictItems, true);
            return dictItems.Count;
        }

In the case of Movies the method is called as follows:

Code: [Select]
genXMLItemOfType("Movie", "MB3Payloads\\Movies.xml");
« Last Edit: February 18, 2015, 05:31:16 PM by jitterjames »

boutzo

  • Jr. Member
  • **
  • Posts: 24
  • Karma: 0
    • View Profile
Re: Github for plugin
« Reply #5 on: February 19, 2015, 11:55:19 AM »
I have asked the question on the MB site because I was getting the same results on there swagger page and ebr told me that the issue was there is a setting called CollapseBoxSetItems and it has to be set to false. After that I got the correct results.  Just fyi.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Github for plugin
« Reply #6 on: February 19, 2015, 12:08:12 PM »
Where can this setting be found?

boutzo

  • Jr. Member
  • **
  • Posts: 24
  • Karma: 0
    • View Profile
Re: Github for plugin
« Reply #7 on: February 19, 2015, 12:50:05 PM »
Its in the swagger documentation under the Items / items bar.  Its got about 20 different settings including the ones you have in your code the one called CollapseBoxSetItems will make movies in subfolders visible and able to be indexed.  It has to be set to false "keeps them from being hidden" I tried it and it works.  Why recursive alone doesn't work I don't know.  Don't forget to put you api key in at the top of the page or you will get error responses.

I see you posted the relevant code but how am I able to access it ?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Github for plugin
« Reply #8 on: February 19, 2015, 06:06:27 PM »
I see you posted the relevant code but how am I able to access it ?

You can't because it is not an open source project.

I can set up my query to set this value to false in the next version, but here's what I find confusing about it.

1 - I have movies that are in box sets.  Some were created automatically and some were created manually.  I always get all my movies back whether I set this variable to false or not.

2 - Why would this value default to true?  It seems like it should already be false by default.

I don't get why you have a completely different result from me, given that we both (presumably) have movies in box sets and movies that are not in sets.  Is it possible that there is some setting on the server's UI that lets a user set this preference?  If there is, I could not find it, but I am not that familiar with MB.
« Last Edit: February 19, 2015, 06:07:53 PM by nime5ter »