Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config.ini.example
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
;innerBracketsReplace="] ["
;innerParenthesesReplace=") ("
;ignoreYearInFilename="false"
;theInFront="false"

; The following is an example of configs that only affect the 'snes' platform.
;[snes]
Expand Down
4 changes: 3 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ humans](https://keepachangelog.com).

- Added: Support for [Batocera gamelists](FRONTENDS.md#batocera) incl. fanart
output
- Added: Support for fanart gamelist output for some [EmulationStation
- Added: Support for fanart gamelist output for ES-DE and some [EmulationStation
variants](CONFIGINI.md#gamelistvariants)
- Added: Fanart scraping with Screenscraper-, TGDB- and Import-scraper. See flag
and config option [`fanarts`](CLIHELP.md#fanarts)
- Added: Support for ES-DE miximages output (aka Skyscraper artwork) with [flag
miximages](CLIHELP.md#miximages)
- Added: Allow more relaxed extension syntax in config options. In addition to
`'*.ext'` also allow `'.ext'` and `'ext'`
- Added: Accept also singular for media flags, e.g. `--flags video` additionally
Expand Down
8 changes: 8 additions & 0 deletions docs/CLIHELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,14 @@ When gathering data from any of the scraping modules many potential entries will

By default Skyscraper doesn't scrape and cache game manuals resources because not all scraping sites provide this data and also only some frontends support PDF display of these game manuals. You can enable it by using this flag. Consider setting this in [`config.ini`](CONFIGINI.md#manuals) instead.

#### miximages

This is an epheremal flag and has only an effect when used with the ES-DE frontend. The miximage feature is coming up with ES-DE 3.4.0 onwards. 'Miximage' in ES-DE is their implementation of Skyscraper's artwork processing. When you set this flag, Skyscraper's artwork file will be stored in the ES-DE miximage media folder. The ES-DE screenshots media folder will contain the plain screenshot of a game. If this flag is unset, the screenshots folder of ES-DE contains the artwork file of Skyscraper (defined by the artwork XML file), which is most likely what you want with ES-DE 3.3.0 or earlier.

!!! warning "Epheremal Flag for ES-DE"

Once the miximage of ES-DE feature has been released, this flag may be removed again from Skyscraper.

#### nobrackets

Use this flag to disable any bracket notes when generating the game list. It will disable notes such as `(Europe)` and `[AGA]` completely. This flag is only relevant when generating the game list. It makes no difference when gathering data into the resource cache. Consider setting this in [`config.ini`](CONFIGINI.md#brackets) instead.
Expand Down
16 changes: 8 additions & 8 deletions docs/CONFIGINI.md
Original file line number Diff line number Diff line change
Expand Up @@ -1074,10 +1074,10 @@ Allowed in sections: Only for frontends `[emulationstation]`, `[esde]` or `[retr
By default Skyscraper doesn't scrape and cache game fanart resources because not
all scraping sites provide this data and also only some frontends support fanart
display. If enabled Skyscraper will collect game manuals for the scraping
modules that provide this data. For frontend Batocera no further option must be
set to enable the output of fanart in the gamelist and into the appropriate
folder during gamelist creation. For other EmulationStation forks where themes
support the display of fanart, see also option
modules that provide this data. For the frontends ES-DE and Batocera no further
option must be set to enable the output of fanart in the gamelist and into the
appropriate folder during gamelist creation. For other EmulationStation forks
where themes support the display of fanart, see also option
[gameListVariants](CONFIGINI.md#gamelistvariants).

Default value: false
Expand All @@ -1090,10 +1090,10 @@ Allowed in sections: `[main]`, `[<PLATFORM>]`
By default Skyscraper doesn't scrape and cache game manuals resources because
not all scraping sites provide this data and also only some frontends support
PDF display of these game manuals. If enabled Skyscraper will collect game
manuals for the scraping modules that provide this data. For frontend ES-DE and
Batocera no further option must be set to enable the output of the PDF manuals
to the appropriate folder during gamelist creation. For other EmulationStation
forks which support PDF manual display, see also option
manuals for the scraping modules that provide this data. For the frontends ES-DE
and Batocera no further option must be set to enable the output of the PDF
manuals to the appropriate folder during gamelist creation. For other
EmulationStation forks which support PDF manual display, see also option
[gameListVariants](CONFIGINI.md#gamelistvariants).

Default value: false
Expand Down
10 changes: 6 additions & 4 deletions docs/FRONTENDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ highlights the differences.
ROMs are expected to be in the input folder `/home/<USER>/ROMs/<PLATFORM>` for
every `<PLATFORM>` you scrape.

Media filepaths (screenshots, marquees, videos, aso.) are not explicitly stored
in the gamelist file. This is ES-DE default. However, Skyscraper will put the
media files into the `downloaded_media` folder (e.g.
Media filepaths (screenshots, marquees, videos, aso.) are not held in the
gamelist file. This is ES-DE default. However, Skyscraper will put the media
files into the `downloaded_media` folder (e.g.
`~/ES-DE/downloaded_media/<PLATFORM>/screenshots/` for screenshots) from where
ES-DE will pick them up. ES-DE does not support textures currently.
ES-DE will pick them up. ES-DE does not support textures currently. Any manual
or fanart data present in the cache will be put automagically into
`~/ES-DE/downloaded_media/<PLATFORM>` where ES-DE will load it.

!!! tip

Expand Down
2 changes: 2 additions & 0 deletions src/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,8 @@ QMap<QString, QString> Cli::getSubCommandOpts(const QString subCmd) {
{"fanarts",
"Enables scraping and caching of fanart for the scraping modules "
"that support them."},
{"miximages",
"Enables output of Skyscraper's artwork as ES-DE miximage."},
};
} else {
QStringList resTypes = Cache::getAllResourceTypes();
Expand Down
11 changes: 9 additions & 2 deletions src/compositor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "compositor.h"

#include "batocera.h" // TODO: Does not fit in here
#include "config.h"
#include "fxbalance.h"
#include "fxblur.h"
#include "fxbrightness.h"
Expand Down Expand Up @@ -289,7 +290,7 @@ void Compositor::addChildLayers(Layer &layer, QXmlStreamReader &xml) {
}

void Compositor::saveAll(GameEntry &game, QString completeBaseName,
bool isBatocera) {
bool isBatocera, bool isEsde) {
bool createSubfolder = false;
QString fn = "/" % completeBaseName;
QString subPath = getSubpath(game.path);
Expand All @@ -313,7 +314,13 @@ void Compositor::saveAll(GameEntry &game, QString completeBaseName,
continue;
}
} else if (output.resType == "screenshot") {
filename.prepend(config->screenshotsFolder);
if (isEsde) {
filename.prepend(Config::lexicallyNormalPath(
config->screenshotsFolder % "/../miximages"));
createSubfolder = true;
} else {
filename.prepend(config->screenshotsFolder);
}
if (config->skipExistingScreenshots &&
QFileInfo::exists(filename)) {
// set screenshotFile to generate XML element later
Expand Down
4 changes: 2 additions & 2 deletions src/compositor.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class Compositor : public QObject {
Compositor(Settings *config);
static bool preCheckArtworkXml(const QString &artworkXml);
void processXml();
void saveAll(GameEntry &game, QString completeBaseName,
bool isBatocera = false);
void saveAll(GameEntry &game, QString completeBaseName, bool isBatocera,
bool isEsde);
QString getSubpath(const QString &absPath);

private:
Expand Down
6 changes: 5 additions & 1 deletion src/esde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ inline const QString baseFolder() {

void Esde::setConfig(Settings *config) {
this->config = config;
if (config->scraper == "cache")
if (config->scraper == "cache") {
config->manuals = true;
config->fanart = true;
}
}

QStringList Esde::extraGamelistTags(bool isFolder) {
Expand All @@ -70,3 +72,5 @@ QString Esde::getGameListFolder() {
QString Esde::getMediaFolder() {
return baseFolder() % "/downloaded_media/" % config->platform;
}

QString Esde::getFanartsFolder() { return config->mediaFolder % "/fanart"; }
1 change: 1 addition & 0 deletions src/esde.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class Esde : public EmulationStation {
QString getInputFolder() override;
QString getGameListFolder() override;
QString getMediaFolder() override;
QString getFanartsFolder() override;

protected:
QStringList createEsVariantXml(const GameEntry &entry) override;
Expand Down
26 changes: 24 additions & 2 deletions src/scraperworker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "batocera.h"
#include "cache.h"
#include "compositor.h"
#include "config.h"
#include "esgamelist.h"
#include "gamebase.h"
#include "gameentry.h"
Expand Down Expand Up @@ -312,14 +313,21 @@ void ScraperWorker::run() {

if (!config.pretend && cacheScraper) {
bool batoceraFe = config.frontend == "batocera";
bool esdeFe = config.frontend == "esde" && config.miximages;
// Process all artwork
compositor.saveAll(game, info.completeBaseName(), batoceraFe);
compositor.saveAll(game, info.completeBaseName(), batoceraFe,
esdeFe);
// extra media files (not part of compositor)
const QString baseName = info.completeBaseName();
const QString subPath = compositor.getSubpath(game.path);
// copy from cache to destination folder
copyMedia(MediaHint::VIDEO, baseName, subPath, game, batoceraFe);
copyMedia(MediaHint::MANUAL, baseName, subPath, game, batoceraFe);
copyMedia(MediaHint::FANART, baseName, subPath, game, batoceraFe);
if (esdeFe) {
copyMedia(MediaHint::SCREENSHOT, baseName, subPath, game,
false);
}
}

// Add all resources to the cache
Expand Down Expand Up @@ -917,6 +925,16 @@ void ScraperWorker::copyMedia(MediaHint mediaHint, const QString &baseName,
data = game.fanartData;
mediaTypeFolder = config.fanartsFolder;
skipExisting = config.skipExistingFanart;
} else if (mediaHint & MediaHint::SCREENSHOT &&
!game.screenshotFile.isEmpty()) {
// ES-DE only
QMimeType mime = db.mimeTypeForFile(game.screenshotFile);
fnExt = mime.preferredSuffix();
cacheFn = game.screenshotFile;
mediaTypeEnabled = true;
data = game.screenshotData;
mediaTypeFolder = config.screenshotsFolder;
skipExisting = false;
}

// assume to ignore the media in gamelist output if skip existing videos /
Expand Down Expand Up @@ -996,13 +1014,17 @@ void ScraperWorker::copyMedia(MediaHint mediaHint, const QString &baseName,
} else {
game.manualFile = absMediaFn;
}
} else {
} else if (mediaHint & MediaHint::FANART) {
if (zapInGamelist) {
game.fanartData.clear();
game.fanartFile = "";
} else {
game.fanartFile = absMediaFn;
}
} else {
// never output when using ES-DE
game.screenshotData.clear();
game.screenshotFile = "";
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/scraperworker.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ class ScraperWorker : public QObject {
enum MediaHint : unsigned char {
VIDEO = 1,
MANUAL = VIDEO << 1,
FANART = VIDEO << 2
FANART = VIDEO << 2,
SCREENSHOT = VIDEO << 3
};
AbstractScraper *scraper;

Expand Down Expand Up @@ -83,8 +84,7 @@ class ScraperWorker : public QObject {

bool limitReached(QString &output);
void copyMedia(MediaHint mediaHint, const QString &completeBaseName,
const QString &subPath, GameEntry &game,
bool isBatocera = false);
const QString &subPath, GameEntry &game, bool isBatocera);
bool matchTitles(const QString &thiz, const QString &that);
QList<QString> splitTitle(const QString &title);
bool matchWords(const QList<QString> theseWords,
Expand Down
2 changes: 2 additions & 0 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,8 @@ void RuntimeCfg::setFlag(const QString flag) {
config->fanart = true;
} else if (flag == "notidydesc") {
config->tidyDesc = false;
} else if (flag == "miximages") {
config->miximages = true;
} else {
printf("Unknown flag '%s', please check '--flags help' for "
"a list of valid flags. Exiting...\n",
Expand Down
1 change: 1 addition & 0 deletions src/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ struct Settings {
bool cacheTextures = true;
bool skipExistingManuals = false;
bool skipExistingFanart = false;
bool miximages = false;

QString innerBracketsReplace = "";
QString innerParenthesesReplace = "";
Expand Down
Loading