mmatyas / pegasus-frontend

A cross platform, customizable graphical frontend for launching emulators and managing your game collection.
http://pegasus-frontend.org
Other
1.19k stars 105 forks source link

game file attr can use collection directory #1034

Closed xrain0610 closed 1 year ago

xrain0610 commented 1 year ago

Now,

The file or list of files (eg. disks) that belong to this game. Paths can be either absolute or relative to the metadata file. If there are multiple files, you'll be able to select which one to launch when you start the game.

But, when I use a standalone directory store metadata , the app can't link the file like:

image

I want the file is ../../../MD/xxx.bin but now it is /xxx.bin

xrain0610 commented 1 year ago

or add a collection directory env ?

mmatyas commented 1 year ago

Hi, a Collection's directory is for automatic searching of files. You may have several directories of Genesis games, for example, and here you can tell the Collection the list of directories, where it looks for them by extension or regex.

A Game's file parameter is a relative path (to the metadata file) or an absolute path. It should be one of the paths found by a Collection. Because different games may have the same filename, the file parameter must be a file path.

xrain0610 commented 1 year ago

is there some way to make one shared directory for mutil platform? I save 4T games on smb share,I want play on win,mac and android use same share directory.

xrain0610 commented 1 year ago

btw,the directory can set an alias, the path can be used in file relative path,I think.

xrain0610 commented 1 year ago

If file must be the path, I don't understand the meaning of the directory

mmatyas commented 1 year ago

Imagine the following directory structure:

C:
├─ Genesis
│  ├─ Games from 1980
│  │  ├─ AlteredBeast.bin
│  │  └─ Tetris.bin
│  └─ Games from 1990
│     ├─ Sonic.bin
│     └─ Tetris.bin
│
└─ Metafiles
   └─ metadata.pegasus.txt

with the following metadata file:

collection: Genesis
extensions: bin
directories:
    ../Genesis/Games from 1980/
    ../Genesis/Games from 1990/

This will find all the BIN files. The directories parameter is for automatic searching. Pegasus looks for files with BIN extension in all the directories you mention in the Collection.

After searching, the Collection contains the following files:

C:/Genesis/Games from 1980/AlteredBeast.bin
C:/Genesis/Games from 1980/Tetris.bin
C:/Genesis/Games from 1990/Sonic.bin
C:/Genesis/Games from 1990/Tetris.bin

Note that there are two Tetris.bin files. This is not an error. Game files may have the same name, so the filename alone is not enough to tell them apart.

Let's extend the metadata file:

game: Sonic the Hedgehog
file: ../Genesis/Games from 1990/Sonic.bin
description: Very fast hedgehog

game: Tetris 1980
file: ../Genesis/Games from 1980/Tetris.bin
description: Tetris from 1980

game: Tetris 1990
file: ../Genesis/Games from 1990/Tetris.bin
description: Tetris from 1990

As you can see, Tetris.bin alone cannot tell the two games apart. The file parameter must be a path to tell them apart.

Hope this helps!

xrain0610 commented 1 year ago

thanks