winnitron / WinnitronLauncher

The official Winnitron launcher! The meat and potatoes of the Winnitron.
winnitron.com
MIT License
34 stars 7 forks source link

Games are duplicated on disk if they're on multiple playlists #32

Open Ludonaut opened 7 years ago

Ludonaut commented 7 years ago

(non-critical issue, just thinking out loud here, feel free to close this if it goes against your goals)

So if I add a game to two different playlists, the launcher downloads the zip once (I think) and writes two separate copies of it into two different folders. This is kinda by design due to the "folders = playlists" structure.

Right now this is totally fine because those games are tiny and there are 13 games in the network total. But I can imagine this becoming a problem in the future, with a machine that has hundreds of games on dozens of different playlists on it.

Wouldn't it be a better idea to store them somewhere once and then just create symlinks* / shortcuts instead of copies? Though this would have to be an option in parallel to the "folders = playlists" design I think. The launcher should support both launching games from playlists folders (like it does now) and via playlist folders containing shortcuts to games stored in some central cache or wherever. Setting up shortcuts manually might get too confusing / complicated for users who want to maintain local-only playlists.

*Not sure if symlinks are a good idea on Windows. There is a command line tool to create symbolic links since Vista, but according to this page it creates weird issues with backups.

aaronklaassen commented 7 years ago

Yeah I'd like to do this too but it'll take reworking a lot of the sync code. It'll happen but not this release.

aaronklaassen commented 6 years ago

Instead of this:

Playlists
  playlist-name
    game-one
    game-two
  another-playlist
    game-one
    game-three

do something like this:

Games
  winnitron_playlists.json
  local_playlists.json
  game-one
  game-two
  game-three

And a script to make the conversion.

Playlist json files don't need all the game data (that's in each game's metadata json):

[
  {
    title: "My Fave Playlist",
    local: true,
    games: [
      {
         slug: "game-one"
      },
      // ...
    ]
  },
  // ...
]