tkashkin / GameHub

All your games in one place
https://tkashkin.github.io/projects/gamehub
GNU General Public License v3.0
2.22k stars 129 forks source link

Not all installed steam games detected as installed #191

Closed Lucki closed 5 years ago

Lucki commented 5 years ago

I've noticed that not all steam games which are installed (according to steam) are recognized as installed by gamehub. This is not related to different steam libraries because two installed games which are in the same library, one is marked as installed the other isn't. Also I can play the uninstalled game just fine. bildschirmfoto-20190204003146-504x178

╭─ lucki@Archlinux   /mnt/Games/Steam_Windows/steamapps/common 
╰─ ls | egrep 'flight_control_hd|RingRunner'   
flight_control_hd
RingRunner
Expected behavior

Every game that is installed in steam should be displayed as installed in gamehub.

Actual behavior

Not all installed games are marked installed in gamehub.

Steps to reproduce

Start gamehub with steam previously set up and notice that not all games are marked as installed.

Version and environment
Version: 0.13.1-1f713f3-master
Branch:  master
Commit:  1f713f3 (1f713f3f3d13385833106c9fc8a9cfccafc0a52b)
Distro:  Arch Linux
DE:      GNOME
tkashkin commented 5 years ago

Game should be installed if:

If these requirements are met, does appmanifest have correct format (including keys case)? Example:

"AppState"
{
    "appid"         "427520"
    "name"          "Factorio"
    "installdir"    "Factorio"
}

Now GameHub expects AppState and installdir keys to have exactly this casing, however it's possible that older Steam installations may have different casing.

Lucki commented 5 years ago

The installdir has different casing: Folder name is flight_control_hd while the appmanifest_62000.acf shows:

"AppState"
{
    "appid"     "62000"
[…]
    "name"      "Flight Control HD"
[…]
    "installdir"        "Flight_Control_HD"
[…]
}

A reinstallation of the game changed the folder to the casing described in the appmanifest and gamehub picks it up as installed.

This will give you a list with games you probably need to look at:

#!/bin/sh

steamapps=$(dirname "$0")

for filename in "$steamapps"/appmanifest_*.acf; do
    dir=$(grep '"installdir"' < "$filename" | sed -r -e 's@\t"installdir"\t\t"(.+)"@\1@g')

    found=0
    for folder in "$steamapps"/common/*/; do
        if [ "$dir" = "$(basename "$folder")" ]; then
            found=1
        fi
    done

    if [ $found -eq 0 ]; then
        echo "look at: $(basename "$filename")/$dir"
    fi
done
tkashkin commented 5 years ago

227 fix should have fixed this as well.