YAMJ / yamj-v2

Yet Another Movie Jukebox (YAMJ) v2
GNU General Public License v3.0
28 stars 11 forks source link

specify sort order of 'Other' category for XML output #1696

Closed Omertron closed 9 years ago

Omertron commented 9 years ago

Original issue 1697 created by Omertron on 2010-11-07T18:37:45.000Z:

currently the XML of Other category generates this: <category name="Other" current="true"> <index name="All">Other_All_1</index> <index name="Movies">Other_Movies_1</index> <index name="New" current="true" first="Other_New_1" previous="Other_New_16" next="Other_New_2" last="Other_New_16" currentIndex="1" lastIndex="16">Other_New_1</index> <index name="New: Movies">Other_New$3A Movies_1</index> <index name="New: TV">Other_New$3A TV_1</index> <index name="TV Shows">Other_TV Shows_1</index> <index name="Top250">Other_Top250_1</index> </category>

I'd like a parameter such as this: mjb.categories.other.sortorder=All,New: TV,New: Movies,TV Shows,Movies,Top250

or add a sort node to the category.xml file <categories> <category name="All"> <enable>true</enable> <rename>All</rename> <sortorder>1</sortorder> </category>

Omertron commented 9 years ago

Comment #1 originally posted by Omertron on 2011-06-06T16:19:57.000Z:

Hi,

this is an attempt to let users customize the 'Other' indexes. You can choose which of them you want and the order they are listed (see attached MovieJukeboxXMLWriter.java file). The property for this is mjb.categories.Other.List (see attached properties file). I tested it with GTspecial and Eversion skins and it seems to work fine.

Omertron commented 9 years ago

Comment #2 originally posted by Omertron on 2011-06-07T09:14:49.000Z:

Hi,

It's a good work around, but I don't really want another configuration setting if I can help it. I'd prefer to either add a tag to the Categories.xml file so that you can specific an explicit order, or better yet, actually have the implicit order kept (the order that they appear in the categories file)

The categories are correctly read in by the XML reader and stored in the order they appear in the XML file, so the problem doesn't lie there, it's when they are written out, so I "just" need to redo that part of the XML writer method.

Omertron commented 9 years ago

Comment #3 originally posted by Omertron on 2011-06-07T21:16:03.000Z:

New attempt ;-) Now the order of the categories-default.xml file entries is used. If you want to have less indexes delete or deactivate them in the xml file. But since I'm not an expert there could be an easier or more elegant solution for this.

Omertron commented 9 years ago

Comment #4 originally posted by Omertron on 2011-06-08T09:55:22.000Z:

This issue was closed by revision r2486.

Omertron commented 9 years ago

Comment #5 originally posted by Omertron on 2011-06-08T09:56:55.000Z:

I took a slightly different approach.

I didn't like duplicating the index writing functionality, so I moved that out to a new private method.

Then just looped round the categoriesMap (as that is stored in order) and processed each one in turn

Omertron commented 9 years ago

Comment #6 originally posted by Omertron on 2011-06-08T11:23:37.000Z:

Thank you very much for implementing this!

But one question: the 'writeIndexPage' part (MovieJukeboxXMLWriter.java) also creates a 'Other'category index in all index XML files. Did you leave that out purposely or have you just overlooked it? The reason why I originally was so interested in this issue and tried to solve it were skins like eg. GTspecial and PPP3 using these index XMLs for their index menu.

Omertron commented 9 years ago

Comment #7 originally posted by Omertron on 2011-06-08T12:23:27.000Z:

This issue was updated by revision r2489

Omertron commented 9 years ago

Comment #8 originally posted by Omertron on 2011-06-09T11:52:21.000Z:

This issue was updated by revision r2500.

Remove duplicate New categories