Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Mitch

An unofficial Android client for itch.io · By gardenapple

Additional filtering functionality

A topic by pkcheap created Jun 19, 2022 Views: 437 Replies: 13
Viewing posts 1 to 4

Hi there, Great work on this app--Just installed version 2!

I just wondered if you were considering adding exclusionary filters to your search functionality (so like search titles where genre != to what is selected for example).

I'm not sure if itch's web API includes that capability but I'm curious to find out. Would love to see if i can contribute as well.

Cheers, and best of luck with your bachelor's

Developer

I don’t use any APIs for search, I just use their web pages, if the web page does not show needed information then I can’t use it for filtering.

The list does display a genre for a game, in theory I could filter out some games using that, but that’s not a great solution because games actually have multiple genres (e.g. Action/Adventure) which are not shown.

(1 edit)

Ahh, understood. I took a look at the docs, and it doesn't look like there's any functionality there for querying their library. And you're right about titles having more than just the displayed genre so there would be some edge cases where filtering them out in the dom wouldn't work. Client-side filtering shouldn't really be done anyway.
EDIT: itch does currently have a exclusion filtering method that using query params: https://itch.io/games/platform-android?exclude=tg.visual-novel
But it isn't well supported by the team. (Yes it is the over-saturation of visual novels for android on itch that spurred on this post, lol)

Me again,
I forked your project on Source Hut and added the functionality menu option. Seems to work with the exception of refreshing cached content. Basically if you load the start page with "Popular Android Games" selected, go into the settings and switch the start page to "Popular Android Games (non-visual novels)", and finally go back and refresh the page, the content that was already loaded will not change. You have to scroll down, loading more items for it to take effect.
I don't have any experience with Kotlin, but I suspect that this is because you are not navigating to a different endpoint--just adding a query string to one that's already been visited. I guess that's how the application decides when to use cached content. Please take a look at your convenience:
https://git.sr.ht/~apriestley/mitch

Developer

I’d looked at the code earlier and it didn’t seem like a great solution to me, I’d rather have genre exclusion as a separate option so users could disable any genre(s), not just visual novels, and not just for Android.

I didn’t know that there was even a way to exclude stuff with the URL query so that’s cool, I have to thank you for that! But I’m probably gonna implement it in a slightly different way, sorry.

Yeah I totally agree. If i had the time i would implement it in the way you described, but i guess my fork is more of a demonstration that it is possible using the API, no need to apologize!

One thing that should be pointed out though, is that there is currently no way to apply an array to the exclude parameter. You can only exclude one property. Took me a while to find that out.

(2 edits)

Sounds pretty game changing given the biggest and most common complaints about indie projects, but just to be sure:

Is exclusion tags (and/or exclusion filters) a real possibility for Mitch? 

Right now I use the quick fix the OP shared that was given by the dev here: *https://itch.io/t/160014/can-i-use-exclusion-filters 

And sadly you can't exclude multiple tags using that.

Is something like excluding multiple tags being considered/worked on for Mitch?


EDIT: link fixed

It can't be done gracefully with a client. Since there is no way to apply multiple tags at the API level, in order to get the job done, you need to resort to throwing away the data you don't want after the query response comes back. Instead of, well, just not pulling it down in the first place.
Not worth it in my opinion, especially considering the itch developers may decide to implement the API level filter in the future.
But of course it's gardenapples application.

I think removing tags from search results is a reasonable work around (I have zero programming knowledge btw so not sure if that's what you mean). 

Anyway if the feature is too awkward or difficult to add I understand. I'm not sure about the dev's given how many years it's been requested. I think I'll keep my expectations low and/or think of something by myself.

Developer (2 edits)

I started working on Mitch again, will implement this ~~tomorrow~~ soon, shouldn’t be too difficult. The current plan is:

  • Have two filters:
    • A “primary filter” using this hack that pkcheap found
      • This can be specified through the Settings menu
      • Will apply only to the main page, and only if the main page is set to Android games or web games
    • “Secondary filters” on the client-side
      • Can be applied anytime on https://itch.io/games but can not be saved
      • Only works with genres instead of tags
  • When/if itch.io adds proper filtering functionality on the server-side, the two filters will be merged.
  • I will not support filters for anything besides games

Not gonna be the most elegant solution but hopefully powerful enough, and not too confusing for users.

That sounds great--I appreciate your efforts.
Just want to ask though.. why apply the primary filter only for android and web?  I get that the point of the app is to platform games meant to run on android, but that explicit restriction just sounds like more work for you. That parameter I think can be applied to any request with a uri containing the /games fragment. I don't think anything would be lost if you allowed any uri meeting that condition to have access to that functionality.

Developer

Ah, sorry, I forgot that the start page can also be set to ‘Popular games’ without an OS restriction. Yes, the filter works with that, too, there is no explicit restriction there.

Developer

Implemented in v2.1.0

Thanks for this--works exactly as you described.
There is a minor visual bug pertaining to dark mode. The modal background remains white, while the font, I presume is changing to white as it should. So, invisible font.