Coder Social home page Coder Social logo

marcrobledo / retroarch-playlist-editor Goto Github PK

View Code? Open in Web Editor NEW
110.0 11.0 13.0 2.42 MB

This web app allows you to create and edit .lpl playlist files for RetroArch.

Home Page: https://www.marcrobledo.com/retroarch-playlist-editor/

License: Other

HTML 6.91% JavaScript 82.22% CSS 10.87%

retroarch-playlist-editor's Introduction

RetroArch Playlist Editor

This web app allows you to easily create and edit .lpl playlist files for RetroArch.

Features:

  • drag and drop existing playlists and/or content
  • sorts playlist content
  • edits content path and core massively
  • remove region and language tags massively
  • internal databases can set correct content names for Arcade playlists (MAME or FB Neo)
  • compatible with both LPL formats (JSON and Legacy)
  • useful for arranging and editing playlists for handheld and console RetroArch versions
  • made in vanilla JS, compatible with all current web browsers

Usage

RetroArch Playlist Editor interface tries to be as minimalist as possible and it's mostly self-explanatory.

Import content button: allows you to browse your files and add content to the current playlist (or just drag and drop them in the window). Alternatively, this button can also be used to open an existing .lpl playlist.

Edit content button: lets you edit massively the selected items (rename, set core, content path...)

retroarch-playlist-editor's People

Contributors

marcmax avatar marcrobledo avatar robloach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

retroarch-playlist-editor's Issues

Can't import content by folder

Can only import individual files not entire folders.
I'm using android and the drag and drop feature is not applicable.

Edit content shall only open on double click (pointer devices) or long-press (touch devices)

  • As of 2022-02-14 the "Edit Content" dialog opens on single click.
  • This assumes that "Edit content" is the main and only function of Playlist Editor.
  • Which it is not!

Selecting to then move or delete is as important!

  • And in order to do this you currently always have to click, then close the dialog by mouse or ESC. Only then resume.
  • Quite cumbersome

Proposal

  • Single click only selects
  • Double click (on pointer devices) or long-press (on touch devices) opens the "Edit Content" dialog

JSON syntax error, missing escape character

json_escape

Specifying default core path in RetroArch Playlist Editor strips escape characters from the default_core_path. A syntax error will occur and all entries will be lost. The lpl below was created within RetroArch.

Offer export option "Keep core as-is" (core_path and core_name remain unchanged)

  • In case of someone just merging playlists, it's best to just keep it as is!
  • Instead of trying to normalize, but instead break it, which is the case in your hosted web app of 2022-02-14.
  • So please at least just offer the option "Keep core as-is"
  • Currently you only offer concrete core-schemes or DETECT, but no "keep as-is" option.

Playlist export option core as Android

Playlist export option core as DETECT

Playlist v1 5 and how its exported as v1

Export options db_name must be left as-is so that thumbnails are shown for mixed system playlist (cross-platform or cross-folder ROMs)

The web app as hosted as of 2022-02-14 transforms db_name to that of the playlist name.

  • That is wrong. But no wonder, because the user documentation on this was wrong!
    • Which I found out by experimentation, and meanwhile already updated the user docs accordingly.
    • My version is here for reference and meanwhile it was already accepted to the official user docs
  • The key finding, which is relevant for this issue:

The db_name attribute entry must be the ROM's corresponding Exact Game Platform Playlists Name.lpl (e.g. Nintendo - Game Boy.lpl) in order to be associated with the correct metadata and thumbnails.

  • Here is a screenshot which shows that db_name gets set to Name of the new playlist.lpl which will result in thumbnails and metadata not being found in your custom created playlist:
    Playlist v1 5 and how its exported as v1

Importing content creates cut-off filepaths

Essentially whenever I import content the filepath is entered as say ./roms/ instead of the actual filepath of D:games/retroarch/roms/game.etc. Oddly enough this worked for SD cards and my Wii-U but not my plain old PC.

image

More keyboard commands

A pre-requirement for both mouse-based or keyboard-based selection to work efficiently is #23

As soon as this is implemented I propose to add more keyboard commands for selection and moving selection:

  • Move focus up/down by ArrowKeyUp/ArrowKeyDown
  • Extend selection with shift + ArrowKeyUp/ArrowKeyDown
  • Move up with alt + ArrowKeyUp/ArrowKeyUp (as in many text editors, IDEs)

More advanced ones:

  • Select all items with ctrl-A (cmd-A on Mac)
  • Extend selection to top item with ctrl-up (cmd-up on Mac)
  • Extend selection to bottom item with ctrl-down (cmd-down on Mac)

games do not load

I have been trying to make a SNES playlist to use on my switch. I was able to make one for my PSX games but i cant get my SNES roms to load in the list it just tells me content can not be loaded. My SNES roms are zipped if that makes a difference. I set the file path just like i did for the PSX games so i dont thing i messed up there.

Playlists has no icons and only black squares when I load them

The playlists just have black squares and no icons when load them in RetroArch on my Nvidia Shield TV. The auto generated playlists made from scanning the directories have the right monocrome icons but these just get black boxes. It is not very pleasant and quite annoying. Is this something I can fix on my own or is this a problem with this great editor?

Preserve playlist options

Reproduction

  1. Import a playlist in version 1.5 format which also has playlist options like this:
{
  "version": "1.5",
  "default_core_path": "",
  "default_core_name": "",
  "label_display_mode": 5,
  "right_thumbnail_mode": 0,
  "left_thumbnail_mode": 0,
  "sort_mode": 0,
  "items": [
    {}, {}, {},  # Playlist items
  ]
}
  1. Perform your playlist operations.
  2. Click "Save playlist".
  3. Inspect the resulting playlist.

Actual

  • The playlist options are lost on export.

Expected

  • The playlist options (in the JSON "header" before the "items" array) is preserved in the export.

  • If you drag-n-drop multiple playlists (consecutively) onto Playlist Editor, it takes the options of the first playlist that was dropped. Otherwise you would need to take care of how to unite the options, which would need quite some logic or user intervention.

  • As soon as the second playlist is dropped, throw a toast message (of severity "info", the ones which disappear by themselves after a timeout) like this:

    Imported more than 1 playlist

    • ROM items from multiple playlists got merged successfully.
    • But playlist options are only considered from the first playlist.

Workaround

  • Export playlist. Then re-insert the header snippet from a backup of the playlist. Save.

Screenshot

Playlist v1.5 and how its exported as v1

Add select / checkbox for regions

For example I would like split games by playlist for each region ( Europe / USA/ japan)

Other solution would be create custom priority of removing dupes, for example I would like have first Europe, if exist, then USA, and only then JP, now it takes what first found

Thanks for this very useful tool!

I thought I will do my playlist editing in a spreadsheet app and already searched for json2csv and csv2json tools.

So nice to get a readymade solution!

Great that you can very easily merge content of files just by dropping them consecutively.

Thanks! I will check the RetroArch docs/wiki and see whether it mentions your tool.

If not there I will try to add it there as a recommended helper tool.

CRC checksum is not calculated for certain file types (e.g. z64, nds)

Reproduction

  1. Drag'n'drop a ROM file onto the editor.

Expected

  1. ✅ The app is processed locally only (no server side processing).
  2. The app analyses the file type by a combination of:
  • a) checking the file name extension,
  • b) checking the file signature (first few bytes aka "file magic")
  1. If the file type is a generic file archive file type (e.g. ZIP, 7Z, GZIP, etc) it looks inside it, identifies the main ROM file in it, else consider the file itself as the ROM file.
  2. Then calculates the CRC32 checksum of the file identified as the ROM file.

Actual

  • Step 1 happens locally only, which is way faster, and more private too. This is what my network analysis has shown.
  • Steps 2-4: I don't know how it works in detail, but I observed these end results:
  • .zip containing a .gb result in /path/to/Archive File Name.zip#ROM File Name.gb with the CRC32 being calculated
  • .z64 results in /path/to/Archive File Name.z64 with "crc32": "00000000|crc"
  • .nds results in /path/to/Archive File Name.nds with "crc32": "00000000|crc"

Considerations

  • Maybe this is normal behavior anyhow and the forementioned filetypes are expected to produce no CRC32 checksum, e.g. because there is not a single ROM within them, but multiple ROM files, and there is no standardized way to calculate an unambiguous CRC32 for them, and they are identified by other means.
  • It is just an observation I wanted to share at least.

Update available Core list

Reproduction

  1. Create your playlist as needed.
  2. Select multiple entries
  3. Click "Edit content"
  4. The editing dialog opens
    • Edit the option "Core"

Actual

  • The options available are a bit dated

Expected

  • Please update to the newest list of available cores.
  • E.g. "Playstation (Duckstation)" is not listed.

New "Genre" column + "Export playlist per each genre"

Feature request

General idea

  • You can assign one or multiple genres per each game, e.g. "Shooter" and "Aircraft".
  • When exporting the app creates one playlist per each genre, which contains all the matching games. So in our example a playlist "Shooter" and a playlist "Aircraft" and if you choose the combined export option "Genre - Subgenre" too, then also a playlist "Shooter - Aircraft".

Possibilities in detail

  • You manage a single master playlist (inventory) and per each game can define "Genre(s)" in a new column.
  • You either use that master playlist once or you save it locally and at a later time reload it into the editor, then complete/refine, and then re-export the genre playlists from it.
    • Even if filepaths change, you can easily changed them in batch later.
  • From this single master playlist you can export various combinations of "genre / subgenre / platform" combinations/permutations to satisfy various playlist curation needs.
    • Be it simply "Main Genre" or "Main Genre - Subgenre" or even "System - Main Genre" or "Main Genre - System".

Proposal: Layout change

  • The main editor UI gets a new column "Genre(s)".
  • By default this column remains empty.
    • Behavior for users not interacting with this column will stay exactly as-is.
    • But pro users get a new capability when editing the genre values.
  • It behaves for editing like all other columns, so when selecting a single or multiple items and you click "Edit content" the "editing dialog" opens and there you have a "Genre(s)" field, which you can edit individually or in batch for a multi selection.
  • Its values are TAB or comma separated (I prefer TAB as the macOS Finder copies its tags as a TAB separated list, handy for copy/paste)

User Story + App behavior and interactions

  1. The user drag'n'drops games from platform "smd" onto the editor:
Name Filename Core Genre(s) CRC
A a.zip ✔︎
B b.zip ✔︎
  1. The user selects all "SMD" games and then in batch changes their common root filepath:
Name Filename Core Genre(s) CRC
A /roms/smd/a.zip ✔︎
B /roms/smd/b.zip ✔︎
  1. The user has drag'n'dropped multiple "SNES" games and then assigned them their common root filepath:
Name Filename Core Genre(s) CRC
A /roms/smd/a.zip ✔︎
B /roms/smd/b.zip ✔︎
C /roms/snes/c.zip ✔︎
D /roms/snes/d.zip ✔︎
  1. The user has assigned genres to all games:
Name Filename Core Genre(s) CRC
A /roms/smd/a.zip Puzzle ✔︎
B /roms/smd/b.zip Jump'n'Run, Multiplayer-2 ✔︎
C /roms/snes/c.zip Shooter, Aircraft ✔︎
D /roms/snes/d.zip Jump'n'Run, Adult ✔︎
  • The tab or comma separated values within the "Genre(s)" column preserve their tag order ("weighted" from most to least significant one). Tag order preservation is crucial for certain export patterns like "Main Genre - Sub Genre".
  1. The user clicks the command Export playlist(s).
  • As long as the column "Genre(s)" was empty that command is shown in singular only Export playlist and behaves as-is.
  • As soon as the column "Genre(s)" is filled somewhere, then that command label has changed to Export playlist(s) to indicate the extra functionality, and the following export dialog differs in scope accordingly.
  1. The "export dialog" for Export playlist(s) looks a follows:
  Name of main playlist:
    AAA - All Games.lpl

  Core Path: [ Windows RetroArch within LaunchBox ▾ ]
    C:\\LaunchBox\\…

☐ Export playlist variants / combos:
   [ Main Genre  ▾ ]

   Resulting playlist(s): 3 in total
     Games  Playlist-Name ▾
         2  Jump'n'Run
         1  Puzzle
         1  Shooter

Explanations / Remarks on the dialog

  • Name of main playlist:
    • AAA - All Games.lpl by default if playlist was freshly generated,
    • or the existing filename if an .LDL file was opened/imported in the editor.
  • ☐ Export playlist variants / combos — By default is off
    • The playlist pattern selector (dropdown menu) is visible but greyed out.
    • The Resulting playlist(s) section is also greyed out but nevertheless generated according to the default pattern, to convey the idea of that optional feature to the user.
  • When enabling ☑︎ Export playlist variants / combos is activated, the pattern selector gets activated…
    • … offering these choices:
      • Genre — Creates a playlist per each encountered genre, no matter of its position/depth in the assignment.
      • Main Genre
      • Main Genre - Sub Genre
      • Main Genre with as many sub genres as there are
      • Main Genre - System Longname
      • Main Genre - SYS
      • System Longname - Main Genre
      • SYS - Main Genre
    • … and section Resulting playlist(s) updates accordingly.
      • The preview is a simple sort-able table with the columns Playlist-Name (by default sorted alphabetically) and Games (count of games in that playlist, click into the column header to sort by this to observe which playlists are smaller/larger). That table is scrollable and has a max-height of 4.5 lines (cutoff to indicate "scrollable content" to the user).
      • If the choice yields a high number of playlists, then the user may be careful.
      • The app may add a limit, e.g. 220 in total — ❗️ Export limited to 25 playlists! Choose a playlist name pattern which results in fewer playlists or reduce the number of entries in the "Genre(s)" column.
  • Download/Delivery: When clicking "Export playlists" in that dialog, if downloading multiple .LPL files consecutively is not feasible instead pack them into All-Playlists.zip and download this archive which contain all the playlists. Many browsers anyhow automatically decompress ZIP archives (e.g. Safari).

Reordering elements

Would it be possible to add the ability to reorder elements? There are some titles that should theoretically appear before another but do not.

For example:

Mega Man 2: The Power Fighters
Mega Man: The Power Battle

In instances like this, it would be most preferable to easily be able to reorder the items so that Mega Man: The Power Battle would appear first.

Chokes on playlist files containing JSON comments

Reproduction

  • Import a LPL file in JSON format which has some comments in it

Actual

  • Playlist Editor as of 2022-02-14 chokes on them, you get a broken list.

Expected

  • Minimum fix: Drop all comments during import.
    • Machine produced playlists likely not contain them.
    • But you never know, maybe some playlist apps use comments to add proprietary tags or user comments that way.
    • Or users put manual remarks their.
  • Better: Drop all comments which are on their own lines. Hard to determine to which part the supposedly belong too, when reordering items. But keep the comments which are at the end of a line after the respective key/value pair. Clear that it belongs their. Not necessary. If do-able without too much effort maybe a convenient options, if some users may keep remarks regarding ROMs like this.
  • Best: Keep all comments. But requires some logic. Overkill IMHO.

Screenshot

Playlist Editor chokes on playlist files with JSON comments

Sample file Playlist-with-comments.lpl

{
  "version": "1.5",
  "label_display_mode": 3,
  "right_thumbnail_mode": 0,
  "left_thumbnail_mode": 0,
  "sort_mode": 0,
  "items": [
    {
      "path": "1",            // Comment after the key/value pair.
      "label": "Game 1",           // Comment after the key/value pair.
      "core_path": "/data/user/0/com.retroarch.aarch64/cores/duckstation_libretro_android.so",
      "core_name": "Sony - PlayStation (DuckStation)",
      "crc32": "1",           // Comment after the key/value pair.
      "db_name": "Sony - PlayStation.lpl"
    },
    {
      "path": "2",
      "label": "Game 2",
      "core_path": "/data/user/0/com.retroarch.aarch64/cores/duckstation_libretro_android.so",
      "core_name": "Sony - PlayStation (DuckStation)",
      "crc32": "2",
      "db_name": "Sony - PlayStation.lpl"
    },

      // Comment on its own line. Not so easy to determine to which JSON element it belongs.

    {
      "path": "7",
      "label": "Game 3",
      "core_path": "/data/user/0/com.retroarch.aarch64/cores/mupen64plus_next_gles3_libretro_android.so",
      "core_name": "Nintendo - Nintendo 64 (Mupen64Plus-Next)",
      "crc32": "",
      "db_name": "Nintendo - Nintendo 64.lpl"
    },
    {
      "path": "8",
      "label": "Game 4",
      "core_path": "/data/user/0/com.retroarch.aarch64/cores/duckstation_libretro_android.so",
      "core_name": "Sony - PlayStation (DuckStation)",
      "crc32": "8",
      "db_name": "Sony - PlayStation.lpl"
    }
  ]
}

Core path: Add more options

Reproduction

  1. Create your playlist as needed.
  2. Save playlist
  3. The save dialog opens
    • Core Path has currently two options
    • - none -
    • C:\LaunchBox\Emulators\RetroArch\cores\*_libretro.dll

Proposal

Add further options:

  1. Custom: Filepath containing asterisk.
    • Hint text: Make sure it contains a single asterisk. On export that part will be replaced with the specific Core.

Further options with default filepaths for these app/OS installations:

  1. RetroArch on Android
  2. RetroArch Plus on Android
  3. RetroArch on Windows
  4. RetroArch on macOS

Rename thumbnails match to the playlist name

Hello, thanks you for your awesome tool! can you add feature to rename thumbnails match to playlist name? my thumbnail match to roms name, but retroarch read the playlist name to display thumbnails, need to rename one by one will be pain, thank you in advance

Allow to extend selection by clicked item

Reproduction

  • You have an active selection (possibly by help of #24)
  • You want to extend it by certain single non-consecutive items

Actual: Not possible

Expected: Click with modifier-key down (cmd on Mac, ctrl on Window/Linux)

User Rationale: Select multiple items to move or delete, a quite frequently used function in any playlist editor

New cores support

Since RetroArch started to support new cores such as Final Burn Neo, could you please add these cores to the editor? Thanks!

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.