LivingWithHippos / unchained-android

App to interact with real-debrid API
GNU General Public License v3.0
406 stars 50 forks source link

[BUG] Custom plugins don't display search categories (only "all") #289

Closed elpocoburrito closed 1 year ago

elpocoburrito commented 1 year ago

Describe the bug I tried bringing my Sukebei Nyaa plugin into a new repository following PLUGINS.md instructions. I also fixed category search in the plugin to use the actual categories from Sukebei instead of the ones from Nyaa. While testing the result, I found that regardless of what i tried, I couldn't make the app display categories for non-official plugins. At first i thought it was a special character issue but even with only alphanumeric characters and spaces, the category menu would only offer the "All" category for my plugin, while they worked fine with the official plugins.

The "All" category worked fine though and returned results properly,

Here is my plugin, if you need to test: Plugin

Note: There is a minor glitch when changing plugins where you sometime see another plugin's categories instead of the ones for the currently selected plugin. Simply switching to another plugin and then re-selecting the desired one fixes it though.

To Reproduce Steps to reproduce the behavior:

  1. Add my plugin in whichever way you prefer.
  2. Click on 'search'.
  3. Select my plugin in the search section.
  4. Try to choose a category.
  5. Only 'All' is available even though many categories are specified in the plugin JSON and the syntax of the plugin is exactly the same as the official nyaa plugin outside of changes to the name, description, authors and categories, which all seem to use valid JSON syntax to me.

Smartphone (please complete the following information):

Additional context

LivingWithHippos commented 1 year ago

The categories keys are "fixed", you cannot change them. This was made for allowing better translations and easier json parsing (only known json keys are easy to use).

I'm adding more categories to allow for easier management of situation like yours

  "supported_categories": {
    "all": "None",
    "art": "Art",
    "anime": "Anime",
    "doujinshi": "Doujinshi",
    "software": "Applications",
    "games": "Games",
    "manga": "Manga",
    "movies": "Movies",
    "pictures": "Pictures",
    "videos": "Videos",
    "music": "Music",
    "tv": "TV",
    "books": "books"
  },

the part on the left cannot be changed, change only the ones on the right. Update the engine version to 2.4