Lyle-Tafoya / Steam-Categorizer

Automatically generate categories for games in your Steam library
GNU General Public License v3.0
25 stars 2 forks source link

Error creating the steam config #21

Closed paris-ci closed 7 years ago

paris-ci commented 7 years ago

Launched with : ​ $ steam-categorizer -p ~/.config/steam_categorizer.json -c ~/Library/Application\ Support/Steam/userdata/131245987/7/remote/sharedconfig.vdf

...
 INFO  Steam::Categorizer::GameLibrary : Getting game page for Transformice...
 INFO  Steam::Categorizer::GameLibrary : Getting game page for Worm.is: The Game...
 INFO  Steam::Categorizer::GameLibrary : Generating steam config...
/Users/arthur/.rvm/gems/ruby-2.3.1/gems/steam-categorizer-0.5.5/lib/steam/categorizer.rb:141:in `generate_steam_config': undefined method `each' for nil:NilClass (NoMethodError)
    from /Users/arthur/.rvm/gems/ruby-2.3.1/gems/steam-categorizer-0.5.5/exe/steam-categorizer:23:in `<top (required)>'
    from /Users/arthur/.rvm/gems/ruby-2.3.1/bin/steam-categorizer:22:in `load'
    from /Users/arthur/.rvm/gems/ruby-2.3.1/bin/steam-categorizer:22:in `<main>'

config :

{
  "sharedConfig": "~/Library/Application Support/Steam/userdata/131245987/7/remote/sharedconfig.vdf",
  "tagPrefix": "| ",
  "urlName": "newm1ne",
  "categoryMaps": {
    "communityTags": {
      "2D Fighter": [ "Fighting" ],
      "3D Platformer": [ "Platformer" ],
      "Action": [ "Action" ],
      "Action RPG": [ "Action", "Role Playing Game" ],
      "Adventure": [ "Adventure" ],
      "Beat 'em up": [ "Fighting" ],
      "Bullet Hell": [ "Shooter" ],
      "Casual": [ "Casual" ],
      "Dungeon Crawler": [ "Role Playing Game" ],
      "Fighting": [ "Fighting" ],
      "First-Person": [ "Camera: First Person" ],
      "Flight": [ "Flight" ],
      "FPS": [ "Camera: First Person", "Shooter" ],
      "Grand Strategy": [ "Strategy" ],
      "Horror": [ "Horror" ],
      "JRPG": [ "Role Playing Game" ],
      "Metroidvania": [ "Metroidvania" ],
      "Music-Based Procedural Generation": [ "Procedural Generation", "Rhythm" ],
      "Open World": [ "Open World" ],
      "Perma Death": [ "Perma Death" ],
      "Platformer": [ "Platformer" ],
      "Procedural Generation": [ "Procedural Generation" ],
      "Programming": [ "Programming" ],
      "Psychological Horror": [ "Horror" ],
      "Puzzle": [ "Puzzle" ],
      "Puzzle-Platformer": [ "Platformer", "Puzzle" ],
      "Racing": [ "Racing" ],
      "Real-Time": [ "Real Time" ],
      "Relaxing": [ "Relaxing", "Casual" ],
      "Rhythm": [ "Rhythm" ],
      "Rogue-lite": [ "Perma Death", "Procedural Generation" ],
      "Rogue-like": [ "Perma Death", "Procedural Generation" ],
      "RPG": [ "Role Playing Game" ],
      "RTS": [ "Real Time", "Strategy" ],
      "Sandbox": [ "Sandbox" ],
      "Sci-fi": [ "Science Fiction" ],
      "Side Scroller": [ "Camera: Side Scroller" ],
      "Simulation": [ "Simulation" ],
      "Sokoban": [ "Puzzle" ],
      "Sports": [ "Sports" ],
      "Stealth": [ "Stealth" ],
      "Strategy": [ "Strategy" ],
      "Survival": [ "Survival" ],
      "Survival Horror": [ "Horror" ],
      "Tactical": [ "Strategy" ],
      "Tactical RPG": [ "Role Playing Game", "Strategy" ],
      "Third Person": [ "Camera: Over Shoulder" ],
      "Third Person Shooter": [ "Shooter", "Camera: Over Shoulder" ],
      "Top-Down": [ "Camera: Top Down" ],
      "Top-Down Shooter": [ "Shooter", "Camera: Top Down" ],
      "Tower Defense": [ "Tower Defense" ],
      "Turn-Based": [ "Turn Based" ],
      "Turn-Based Combat": [ "Turn Based" ],
      "Turn-Based Strategy": [ "Strategy", "Turn Based" ],
      "Twin Stick Shooter": [ "Shooter", "Camera: Top Down" ]
    },
    "publisherCategories": {
      "Co-op": [ "Multiplayer: Cooperative" ],
      "Cross-Platform Multiplayer": [ "Multiplayer: Cross-Platform", "Multiplayer: Online" ],
      "Local Co-op": [ "Multiplayer: Local", "Multiplayer: Cooperative" ],
      "Online Co-op": [ "Multiplayer: Online", "Multiplayer: Cooperative" ],
      "Online Multi-Player": [ "Multiplayer: Online" ],
      "Shared/Split Screen": [ "Multiplayer: Local" ],
      "Steam Cloud": [ "Steam Cloud" ]
    }
  }
}
Lyle-Tafoya commented 7 years ago

Based on the error message, it sounds like your sharedconfig.vdf file does not contain an "Apps" map where Steam-Categorizer is expecting it to be. Would you be willing to share the contents of your sharedconfig.vdf file?

paris-ci commented 7 years ago

Sure !

"UserRoamingConfigStore"
{
    "Software"
    {
        "Valve"
        {
            "Steam"
            {
                "SSAVersion"        "3"
                "PrivacyPolicyVersion"      "2"
                "DesktopShortcutCheck"      "0"
                "StartMenuShortcutCheck"        "1"
                "AutoLaunchGameListCheck"       "1"
                "apps"
                {
                    "440"
                    {
                        "LastPlayed"        "1370442651"
                        "cloudenabled"      "1"
                        "tags"
                        {
                            "0"     "favorite"
                        }
                    }
                    "212070"
                    {
                        "LastPlayed"        "1368876260"
                    }
                    "243730"
                    {
                        "tags"      ""
                    }
                    "225420"
                    {
                        "cloudenabled"      "1"
                    }
                    "363970"
                    {
                        "cloudenabled"      "1"
                    }
                    "386940"
                    {
                        "tags"
                        {
                            "0"     "favorite"
                        }
                    }
                    "207140"
                    {
                        "tags"
                        {
                            "0"     "favorite"
                        }
                    }
                    "323850"
                    {
                        "tags"
                        {
                            "0"     "favorite"
                        }
                    }
                    "368730"
                    {
                        "tags"
                        {
                            "0"     "favorite"
                        }
                    }
                    "620"
                    {
                        "tags"
                        {
                            "0"     "favorite"
                        }
                    }
                }
                "SteamDefaultDialog"        "#app_store"
            }
        }
    }
    "Web"
    {
        "WebFav0_URL"       "https://www.google.com/"
        "WebFav0_Name"      "Google"
        "WebFav1_URL"       "http://www.youtube.com/"
        "WebFav1_Name"      "YouTube"
        "WebFav2_URL"       "http://www.twitter.com/"
        "WebFav2_Name"      "Twitter"
        "WebFav3_URL"       "http://www.facebook.com/"
        "WebFav3_Name"      "Facebook"
        "WebFav4_URL"       "http://www.reddit.com/"
        "WebFav4_Name"      "Reddit"
        "WebRecent0_URL"        "*****"
        "WebRecent0_Name"       "Redirection du paiement externe"
        "WebFrequent0_URL"      "http://steamcommunity.com/id/newm1ne/"
        "WebFrequent0_Name"     "Communauté Steam :: himself [FR(EN)]"
        "WebFrequent0_Access"       "1"
        "WebRecent1_URL"        "http://steamcommunity.com/id/newm1ne/"
        "WebRecent1_Name"       "Communauté Steam :: himself [FR(EN)]"
        "WebFrequent1_URL"      "https://www.google.ca/?gfe_rd=cr&ei=YRfKV_ykFevK8geP75fYDQ"
        "WebFrequent1_Name"     "Google"
        "WebFrequent1_Access"       "1"
        "WebRecent2_URL"        "https://www.google.ca/?gfe_rd=cr&ei=YRfKV_ykFevK8geP75fYDQ"
        "WebRecent2_Name"       "Google"
        "WebFrequent2_URL"      "**********"
        "WebFrequent2_Name"     "Redirection du paiement externe"
        "WebFrequent2_Access"       "1"
    }
    "TradeInfoHint"     "1"
}
Lyle-Tafoya commented 7 years ago

In your file, it is called 'apps', whereas with my file it is called 'Apps' (upper case 'A'). I can push out a fix for this sometime today. I'll post an update when I have completed.

paris-ci commented 7 years ago

ok :)

paris-ci commented 7 years ago

Tried to replace apps by Apps in my config, but I get :


/Users/arthur/.rvm/gems/ruby-2.3.1/gems/steam-categorizer-0.5.5/lib/steam/categorizer.rb:144:in `block in generate_steam_config': undefined method `each' for "":String (NoMethodError)
    from /Users/arthur/.rvm/gems/ruby-2.3.1/gems/steam-categorizer-0.5.5/lib/steam/categorizer.rb:142:in `each'
    from /Users/arthur/.rvm/gems/ruby-2.3.1/gems/steam-categorizer-0.5.5/lib/steam/categorizer.rb:142:in `generate_steam_config'
    from /Users/arthur/.rvm/gems/ruby-2.3.1/gems/steam-categorizer-0.5.5/exe/steam-categorizer:23:in `<top (required)>'
    from /Users/arthur/.rvm/gems/ruby-2.3.1/bin/steam-categorizer:22:in `load'
    from /Users/arthur/.rvm/gems/ruby-2.3.1/bin/steam-categorizer:22:in `<main>'```
Lyle-Tafoya commented 7 years ago

I fixed both issues you reported and tested with the sharedconfig file you provided here. Please pull the latest version from master and see if it works for you.

paris-ci commented 7 years ago

@Lyle-Tafoya Unfortunately, it don't works for me :


/Users/arthur/.rvm/gems/ruby-2.3.1/gems/steam-categorizer-0.5.7/lib/steam/categorizer.rb:150:in `block (2 levels) in generate_steam_config': undefined method `add' for #<Hash:0x007fef5b7e6308> (NoMethodError)
    from /Users/arthur/.rvm/gems/ruby-2.3.1/gems/steam-categorizer-0.5.7/lib/steam/categorizer.rb:147:in `each'
    from /Users/arthur/.rvm/gems/ruby-2.3.1/gems/steam-categorizer-0.5.7/lib/steam/categorizer.rb:147:in `block in generate_steam_config'
    from /Users/arthur/.rvm/gems/ruby-2.3.1/gems/steam-categorizer-0.5.7/lib/steam/categorizer.rb:142:in `each'
    from /Users/arthur/.rvm/gems/ruby-2.3.1/gems/steam-categorizer-0.5.7/lib/steam/categorizer.rb:142:in `generate_steam_config'
    from /Users/arthur/.rvm/gems/ruby-2.3.1/gems/steam-categorizer-0.5.7/exe/steam-categorizer:29:in `<top (required)>'
    from /Users/arthur/.rvm/gems/ruby-2.3.1/bin/steam-categorizer:22:in `load'
    from /Users/arthur/.rvm/gems/ruby-2.3.1/bin/steam-categorizer:22:in `<main>'

Using version 5061ae12e4a6567878dba33cdbddf9dd77f88671

Lyle-Tafoya commented 7 years ago

Sorry about that. It looks like I introduced a regression. Please try again with the latest version.

paris-ci commented 7 years ago

Congratulations, you fixed the bug ! Everything works perfectly.