Rolv-Apneseth / lib_game_detector

A Rust library for detecting and parsing data about games currently installed on the system
GNU Affero General Public License v3.0
7 stars 0 forks source link

[Lutris] Unable to detect box art if slug and identifier is different #7

Closed Anninzy closed 4 months ago

Anninzy commented 4 months ago

If the slug in the game's yaml is different to the game's identifier (which I think is game_slug in the yaml file), the box art won't be detected.

I found that this is due to the box art being named as [identifier].jpg, and the library is looking for box art with [slug].jpg.

This causes issue if the two are not the same, as in the case with osu's lazer version. Its identifier is set to osu but the slug is osu-osulazer, as the library is looking for osu-osulazer.jpg but the box art in coverart is osu.jpg, it's not detected.

It'd be great if this is fixed, thanks.

Rolv-Apneseth commented 4 months ago

Ah I see. I'll have a look at fixing that, thanks for opening this

Anninzy commented 4 months ago

Ah, I just found out having a png as box art also causes it to not be detected.

Rolv-Apneseth commented 4 months ago

Yeah makes sense I have a lot of those hard-coded. I'll look into that too.

Rolv-Apneseth commented 4 months ago

Could you provide me the file for that game at ~/.config/lutris/games/[slug]-[num].yml?

Rolv-Apneseth commented 4 months ago

Also it's entry in ~/.cache/lutris/game-paths.json if you can, thanks

Anninzy commented 4 months ago

~/.config/lutris/games/osu-osulazer-1712998316.yml:

game:
  exe: osu.AppImage
game_slug: osu
name: osu!
script:
  files:
  - appimage: https://github.com/ppy/osu/releases/latest/download/osu.AppImage
  game:
    exe: osu.AppImage
  installer:
  - move:
      dst: $GAMEDIR
      src: appimage
  - chmodx: osu.AppImage
slug: osu-osulazer
version: osu!lazer
year: 2007

~/.cache/lutris/game-paths.json:

{
  "1": "/home/owner/Games/osu/osu.AppImage",
  ...
}
Rolv-Apneseth commented 4 months ago

I didn't know there were exe definitions without the full path either. I believe I've fixed all 3 issues, think the easiest way to get you to test it for me is to merge it and then update rofi-games (I assume that's what you're using?)

Rolv-Apneseth commented 4 months ago

Cool game btw didn't know about it

Anninzy commented 4 months ago

I didn't know there were exe definitions without the full path either. I believe I've fixed all 3 issues, think the easiest way to get you to test it for me is to merge it and then update rofi-games (I assume that's what you're using?)

Yup, that is what I'm using.

Rolv-Apneseth commented 4 months ago

Cool. I'll merge that, update rofi-games and get you to test it, if that's alright with you

Rolv-Apneseth commented 4 months ago

That's updated now, could you try building it from source? @Anninzy

Anninzy commented 4 months ago

osu is now shown in rofi-games, thank you!

Rolv-Apneseth commented 4 months ago

Great!