Skip to content

Commit

Permalink
database content name guessing improved for multidisc CD games
Browse files Browse the repository at this point in the history
  • Loading branch information
marcrobledo committed Apr 18, 2022
1 parent 3c0de71 commit ae91860
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
2 changes: 1 addition & 1 deletion _cache_service_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ caches.keys().then(function(cacheNames){
});

var PRECACHE_ID='retroarch-playlist-editor';
var PRECACHE_VERSION='2beta1';
var PRECACHE_VERSION='2beta2';
var PRECACHE_URLS=[
'/retroarch-playlist-editor/','/retroarch-playlist-editor/index.html',

Expand Down
34 changes: 30 additions & 4 deletions app/retroarch-playlist-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,16 +568,28 @@ Content.prototype._guessFromDatabase=function(){
var guessedItem=loadedDatabases[this.databaseName][cleanName];

if(!guessedItem)
guessedItem=loadedDatabases[this.databaseName][cleanName+' (Disc 1)'];
guessedItem=loadedDatabases[this.databaseName][cleanName.replace(/( \(.*?\))/, '$1 (Disc 1)')];

if(!guessedItem)
guessedItem=loadedDatabases[this.databaseName][cleanName+' (Disc 1 of 2)'];
guessedItem=loadedDatabases[this.databaseName][cleanName.replace(/( \(.*?\))/, '$1 (Disc 1 of 2)')];

if(!guessedItem)
guessedItem=loadedDatabases[this.databaseName][cleanName+' (Disc 1 of 3)'];
guessedItem=loadedDatabases[this.databaseName][cleanName.replace(/( \(.*?\))/, '$1 (Disc 1 of 3)')];

if(!guessedItem)
guessedItem=loadedDatabases[this.databaseName][cleanName+' (Disc 1 of 4)'];
guessedItem=loadedDatabases[this.databaseName][cleanName.replace(/( \(.*?\))/, '$1 (Disc 1 of 4)')];

if(!guessedItem)
guessedItem=loadedDatabases[this.databaseName][cleanName.replace(/( \([A-Z][a-z](,[A-Z][a-z])*\))/, '$1 (Disc 1)')];

if(!guessedItem)
guessedItem=loadedDatabases[this.databaseName][cleanName.replace(/( \([A-Z][a-z](,[A-Z][a-z])*\))/, '$1 (Disc 1 of 2)')];

if(!guessedItem)
guessedItem=loadedDatabases[this.databaseName][cleanName.replace(/( \([A-Z][a-z](,[A-Z][a-z])*\))/, '$1 (Disc 1 of 3)')];

if(!guessedItem)
guessedItem=loadedDatabases[this.databaseName][cleanName.replace(/( \([A-Z][a-z](,[A-Z][a-z])*\))/, '$1 (Disc 1 of 4)')];

if(!guessedItem && this.crc){
guessedItem=loadedDatabases[this.databaseName]['crc_'+this.crc.toUpperCase()];
Expand Down Expand Up @@ -1344,6 +1356,20 @@ function buildExample(path){
"core_name": "Nintendo - Game Boy / Color (Gambatte)",
"crc32": "DETECT",
"db_name": "DETECT"
},{
"path": "C:\\roms\\psx\\Atlantis - The Lost Tales (Europe) (En,Es,Nl,Sv).m3u",
"label": "Atlantis - The Lost Tales (Europe) (En,Es,Nl,Sv)",
"core_path": "DETECT",
"core_name": "DETECT",
"crc32": "DETECT",
"db_name": "DETECT"
},{
"path": "C:\\roms\\psx\\Final Fantasy VII (Spain) (Rev 1).m3u",
"label": "Final Fantasy VII (Spain) (Rev 1)",
"core_path": "DETECT",
"core_name": "DETECT",
"crc32": "DETECT",
"db_name": "DETECT"
}
]
}, currentPlaylist
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="app-rows app-fill">
<div id="topbar">
<header>
<h1><img src="app/assets/favicon128.png" id="icon" /> RetroArch Playlist Editor <small class="hide-for-mobile">2.0 beta1</small></h1>
<h1><img src="app/assets/favicon128.png" id="icon" /> RetroArch Playlist Editor <small class="hide-for-mobile">2.0 beta2</small></h1>
<div id="topright">
<h2 class="hide-for-mobile">by <a href="/" tabindex="-1" class="author">Marc Robledo</a></h2>

Expand Down

0 comments on commit ae91860

Please sign in to comment.