Giter Club home page Giter Club logo

retroarch-import-playlist's Introduction

RetroArch Import Playlist

Adapt and import foreign RetroArch playlists into RetroArch

What is this for?

Sharing RetroArch playlist files with other users or environments is difficult. That's mainly because those files contain hard coded file names and directory paths, which may not match with your personal setup anymore. This command line program will systematically replace those parts in the file, according to a set of rules defined in a configuration file. Goal is to import someone else RetroArch playlist file, to adapt and make them usable for your personal setup.

The script is limited and does not work in all cases. Missing Rom files or those with different names won't match and are not playable, despite the correct directory part. Simple cases such as Arcade games with standardized names should work well to import. Compressed playlists are not supported.

Install

No installation required. It's a Python script without additional requirements other than Python itself. Download the .py script and run it.

git clone https://github.com/thingsiplay/retroarch-import-playlist
cd retroarch-import-playlist
chmod +x retroarch-import-playlist.py

This project is mainly tested under Linux, but should theoretically also work on Windows.

How to use

There is no GUI. Configure your personal configuration file and run the script with the playlist file as input. According your configuration a new modified file will be written to disk. The location to the new file is printed to terminal.

$ ./retroarch-import-playlist.py "examples/playlists/Arcade - A-Z Uncommon Arcade Games.lpl"
/home/tuncay/Downloads/retroarch-import-playlist/Arcade - A-Z Uncommon Arcade Games.lpl

If you did not configure the settings, then you will most likely get an error message without an output file. The error messages might look scary, that's because I did not handle all cases. Read below how to configure correctly.

Configuration file

In the config file, the base_content_directory points to your main Roms folder. You need to add system rules with their associated Rom folder name. The script will then combine base_content_directory and content_directory for each system, so you don't need to repeat yourself. This project should come with a skeleton file populated with most (if not all) system names already. You just need to fill in those directories you care and have the Roms folder for.

Location

The config file will be searched at some default locations in this order. Whichever is found first will be loaded:

  1. "SCRIPTNAME.ini" (name and path of Python script, but with .ini extension)
  2. "~/.config/retroarch-import-playlist/default.ini" (on Posix/Linux) or "%LOCALAPPDATA%\retroarch-import-playlist\default.ini" (on Windows)

However, you can force to use a specific configuration file with command line argument -c FILE . In this case default locations are ignored, even if the specified file does not exist:

./retroarch-import-playlist.py -c rules/custom.ini

If no directory and extension parts are specified, then extension ".ini" is assumed and file is searched in the config directory "~/.config/retroarch-import-playlist/":

./retroarch-import-playlist.py -c default

Example

[DEFAULT]
base_content_directory = ~/Emulation/Roms
core_directory = ~/.config/retroarch/cores
core_extension = so
output_directory = .
output_filename_prefix =
output_filename_append = .lpl
overwrite_existing_playlist = false
validate_rom_path = true

[MAME]
content_directory = mame

[Sega - Mega Drive - Genesis]
content_directory = megadrive

[Sega - Mega-CD - Sega CD]
content_directory = segacd

[Atari - 2600]
content_directory = atari2600

Definition

[DEFAULT]

  • base_content_directory: Location of your main Roms directory, which contains all the other sub folders specific for the systems. System specific folder names specified under "content_directory" are combined with this base.
  • core_directory: Location where all Libretro cores are installed.
  • core_extension: The file extension for the core to use, such as ".dll" or ".so" in example. The leading dot is optional and will be added automatically when needed.
  • output_directory: Directory where to save the modified file. An empty entry defaults to original input files directory. A dot "." represents the current working directory you (or the script) are in.
  • output_filename_prefix: Additional text to add in front of file name to save. Note, this is adding to the basename of the file.
  • output_filename_append: Additional text to add after the file name. Note this setting also defines the file extension with the dot.
  • overwrite_existing_playlist: Enable this to overwrite existing files when saving the modified playlist. Enable: true, True, 1 or on and disable: false, False, 0 or off
  • validate_rom_path: Enable extra check if the Rom file does actually exist on the specified target directory. Do not include the game entry, if the Rom file cannot be located. Enable: true, True, 1 or on and disable: false, False, 0 or off

[db_name]

System rules. The section name [db_name] should be replaced with the actual database name for the system, such as [Atari - 2600] . This system name can be looked up under "db_name": for entries in the RetroArch .lpl playlist file.

  • content_directory: Roms folder for the associated system, such as "atari2600". This folder name will be automatically combined with base_content_directory defined in the [DEFAULT] section, to build the full path for this system.

Create your own playlist for sharing

Here is a little step by step instructions to quickly create custom playlists. It's basically just copying the Favorites file to your playlist folder.

  1. First go to your configuration directory of RetroArch, where all settings are stored. Remember this directory, it will be important later.
  2. Rename the file "content_favorites.lpl" to preserve your current Favorites list. Or delete the file if you are careless.
  3. Open RetroArch. Browse through all your playlists and have fun. If you click a game then there should be a menu entry "Add to Favorites". Add some games to the Favorites while you are at it.
  4. Close RetroArch, as it gets late. No, just joking, but you need to close it ASAP!
  5. Go to the RetroArch directory you were before.
  6. Copy or move the "content_favorites.lpl" file to the "playlists" folder in the RetroArch directory.
  7. Optionally rename it to something more useful which represents the content of the file, like "Arcade - Best games safe for work.lpl".

And that's basically it. Restart RetroArch and lookup if the new playlist is working as expected. Now you are ready to share that file with the world and set it under fire! Also tell them I sent you and don't forget to tell them about this revolutionary script, so they can import your file as well and keep history repeating itself.

Download playlists

At this place I want to link to some sources with playlists, so you can download and try them to import.

Just have in mind, random playlists are not guaranteed to work. Arcade playlists are more likely to work than most console games with random file names.

See also

retroarch-import-playlist's People

Contributors

thingsiplay avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.