Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Gemba/skyscraper
Browse files Browse the repository at this point in the history
  • Loading branch information
Gemba committed Feb 10, 2024
2 parents 3bb4f99 + fcb979a commit 6ee541a
Show file tree
Hide file tree
Showing 18 changed files with 231 additions and 59 deletions.
13 changes: 13 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# syntax=docker/dockerfile:1

# Dev Container Template (https://containers.dev/templates) based on latest Debian "bookworm" release or use vanilla Debian from Docker Hub instead
FROM mcr.microsoft.com/devcontainers/base:bookworm
# FROM debian:bookworm

# Update, upgrade, and install necessary packages
RUN sudo apt update && sudo apt upgrade && sudo apt install -y qtbase5-dev

# Make (compile) and install Skyscraper
RUN QT_SELECT=5
# These can not be done in a Dev Container, as workspace doesn't exist until after Docker container is created from image, so commands are unaware of source files. Instead, do in `postCreateCommand` of `devcontainer.json`.
# RUN qmake && make -j$(nproc) && sudo make install
32 changes: 32 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
{
"name": "Debian",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
// "image": "mcr.microsoft.com/devcontainers/base:bookworm"
"build": {
// Path is relative to the `devcontainer.json` file
"dockerfile": "Dockerfile"
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-azuretools.vscode-docker"
]
}
},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"

// Actions that are run after the container is created
"postCreateCommand": "qmake && make -j$(nproc) && sudo make install"
}
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
73 changes: 73 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: '18 15 * * 1'

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: [ 'ubuntu-latest' ]
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
# required for all workflows
security-events: write

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
language: [ 'c-cpp' ]
os: [ubuntu-20.04]
config:
-
qt_version: "5.15"
modules: ""
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.config.qt_version }}
modules: ${{ matrix.config.modules }}
cache: true

- name: Init CodeQL DB
uses: github/codeql-action/init@v3
with:
languages: c-cpp

- name: Build Skyscraper
run: |
QT_SELECT=5 qmake
make -j$(nproc)
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,9 @@ packages
*-packages
target
build

# macOS
.DS_Store

# VS Code
*.code-workspace
2 changes: 1 addition & 1 deletion OLDERRELEASES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#### Version 3.5.9 (24th October 2020)
* Implemented the new IGDB v4 authentication method. IGDB will now work again, and requires free credentials. Read more about that [here](https://github.com/Gemba/skyscraper/blob/master/docs/SCRAPINGMODULES.md#igdb)
* Implemented the new IGDB v4 authentication method. IGDB will now work again, and requires free credentials. Read more about that [here](https://gemba.github.io/skyscraper/SCRAPINGMODULES#igdb)
* Improved memory consumption when handing entries back to main thread
* Added '.au3' file extension to id script exception list (Thank you to 'o0alucard0o' for reporting this)

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION="3.9.3-dev"
VERSION="3.10.0"
2 changes: 1 addition & 1 deletion artwork.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This is the default artwork.xml provided by Skyscraper. More examples can be found in '~/.skyscraper'. Be sure to check the full artwork documentation here: https://github.com/Gemba/skyscraper/blob/master/docs/ARTWORK.md -->
<!-- This is the default artwork.xml provided by Skyscraper. More examples can be found in '~/.skyscraper'. Be sure to check the full artwork documentation here: https://gemba.github.io/skyscraper/ARTWORK -->
<artwork>
<output type="screenshot" width="640" height="480">
<layer resource="screenshot" x="20" width="520" height="390" align="center" valign="middle">
Expand Down
2 changes: 1 addition & 1 deletion artwork.xml.example1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This is the default artwork.xml provided by Skyscraper. More examples can be found in '~/.skyscraper'. Be sure to check the full artwork documentation here: https://github.com/Gemba/skyscraper/blob/master/docs/ARTWORK.md -->
<!-- This is the default artwork.xml provided by Skyscraper. More examples can be found in '~/.skyscraper'. Be sure to check the full artwork documentation here: https://gemba.github.io/skyscraper/ARTWORK -->
<artwork>
<!-- Create a screenshot output for the frontend and set its width and height. If no layers are nested inside the output node, it will export the screenshot raw and just resize it according to width and height. If layers are nested inside, it will create an empty canvas of the defined size and composite the layers on top of it. -->
<output type="screenshot" width="640" height="480">
Expand Down
11 changes: 9 additions & 2 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Changes of this Fork
## Changes

### TBA (Version 3.9.3)
### Version 3.10.0 (2024-02-10)

- Feature: Preserve existing `<folder/>` nodes in gamelist or create skeleton
`<folder/>` nodes when ROMs are stored in subfolders within a system folder,
Expand All @@ -13,6 +13,13 @@
`supplementary/bash-completion/Skyscraper.bash` into
`$XDG_DATA_HOME/bash-completion/completions/` (`$XDG_DATA_HOME` is
equivalent to `$HOME/.local/share`). Open a new bash -- et voila!
- Feature: Customizable installation folder when running `make install`. See
`PREFIX` in `skyscraper.pro`.
- Feature: Improved MacOS support. Unified update script
`update_skyscraper.sh` (thanks, @jeantichoc) and Docker support via Dev
Container (kudos, @retrobit).
- Fix: Various minor fixes reported from the community on different setups,
thanks!

### 2023-12-01 (Version 3.9.2)

Expand Down
4 changes: 2 additions & 2 deletions hints.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<hint>You can edit cached resources for any rom by using the '--cache edit' command line option. You can add file names at the end of the command line to edit resources for just those roms, or you can use the '--startat' and '--endat' options to edit a span of roms. Otherwise all roms in the input folder will be edited one by one.</hint>
<hint>Pretty much any command line option can also be set in the '/home/USER/.skyscraper/config.ini' file. That way you don't have to type them on the command line all the time. You can also set a custom config.ini using the '-c' option.</hint>
<hint>The '/home/USER/.skyscraper/config.ini' file contain sections for both main, platform specific and scraping module specific configurations. So if you, for instance, want a certain option to only be applied when scraping a certain platform, just add it to a platform specific section. Check the example at '/home/USER/.skyscraper/config.ini.example'.</hint>
<hint>You can customize the artwork Skyscraper outputs completely by editing the '/home/USER/.skyscraper/artwork.xml' file. Check the full documentation online at https://github.com/Gemba/skyscraper/blob/master/docs/ARTWORK.md. You can even set a custom artwork.xml per platform if you want in '/home/USER/.skyscraper/config.ini'.</hint>
<hint>You can customize the artwork Skyscraper outputs completely by editing the '/home/USER/.skyscraper/artwork.xml' file. Check the full documentation online at https://gemba.github.io/skyscraper/ARTWORK. You can even set a custom artwork.xml per platform if you want in '/home/USER/.skyscraper/config.ini'.</hint>
<hint>You can force a refresh of the locally cached data using the '--refresh' option. Skyscraper will then refetch the requested entries from the scraping sources, instead of loading it from cache. Sort of like Ctrl+F5 in a browser.</hint>
<hint>Skyscraper caches all scraped data in the resource cache. This saves bandwidth for the scraping sources as any rescaping will make use of this cache instead of pounding the servers again.</hint>
<hint>You can import your own data into the resource cache using the 'import' module. You can import both textual and media data. Read more about this at https://github.com/Gemba/skyscraper/blob/master/docs/ARTWORK.md.</hint>
<hint>You can import your own data into the resource cache using the 'import' module. You can import both textual and media data. Read more about this at https://gemba.github.io/skyscraper/ARTWORK.</hint>
<hint>You can prioritize the sources of each resource type by editing the '/home/USER/.skyscraper/cache/&lt;PLATFORM&gt;/priorities.xml'. Each resource type has a node with source nodes inside. If you want to prioritize a certain source for a certain resource type, just move it to the top or add it if it's not already there.</hint>
<hint>You can turn off these hints using the '--flags nohints' command line flag.</hint>
<hint>You can force Skyscraper to never apply any bracket notes (such as '(Europe)' or '[aga]') to the game names by using the '--flags nobrackets' command line flag.</hint>
Expand Down
3 changes: 2 additions & 1 deletion peas.json
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,7 @@
"sony playstation portable"
],
"formats": [
"*.chd",
"*.cso",
"*.iso",
"*.pbp"
Expand Down Expand Up @@ -2162,4 +2163,4 @@
"worldofspectrum"
]
}
}
}
23 changes: 16 additions & 7 deletions skyscraper.pro
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,37 @@ CONFIG += release
QT += core network xml
QMAKE_CXXFLAGS += -std=c++11

unix:target.path=/usr/local/bin
# Installation prefix folder for bin/Skyscraper and etc/skyscraper/*
PREFIX = /usr/local

unix:target.path=$${PREFIX}/bin
unix:target.files=Skyscraper Skyscraper.app/Contents/MacOS/Skyscraper

unix:supplementary.path=/usr/local/bin
unix:supplementary.path=$${PREFIX}/bin
unix:supplementary.files=\
supplementary/scraperdata/check_screenscraper_json_to_idmap.py \
supplementary/scraperdata/convert_platforms_json.py \
supplementary/scraperdata/peas_and_idmap_verify.py

unix:config.path=/usr/local/etc/skyscraper
unix:config.path=$${PREFIX}/etc/skyscraper
unix:config.files=aliasMap.csv hints.xml mameMap.csv \
mobygames_platforms.json peas.json platforms_idmap.csv \
screenscraper_platforms.json tgdb_developers.json \
tgdb_genres.json tgdb_platforms.json tgdb_publishers.json

unix:examples.path=/usr/local/etc/skyscraper
unix:examples.path=$${PREFIX}/etc/skyscraper
unix:examples.files=config.ini.example README.md artwork.xml \
artwork.xml.example1 artwork.xml.example2 artwork.xml.example3 \
artwork.xml.example4 docs/ARTWORK.md docs/CACHE.md

unix:cacheexamples.path=/usr/local/etc/skyscraper/cache
unix:cacheexamples.path=$${PREFIX}/etc/skyscraper/cache
unix:cacheexamples.files=cache/priorities.xml.example docs/CACHE.md

unix:impexamples.path=/usr/local/etc/skyscraper/import
unix:impexamples.path=$${PREFIX}/etc/skyscraper/import
unix:impexamples.files=docs/IMPORT.md import/definitions.dat.example1 \
import/definitions.dat.example2

unix:resexamples.path=/usr/local/etc/skyscraper/resources
unix:resexamples.path=$${PREFIX}/etc/skyscraper/resources
unix:resexamples.files=resources/maskexample.png resources/frameexample.png \
resources/boxfront.png resources/boxside.png resources/scanlines1.png \
resources/scanlines2.png
Expand All @@ -42,7 +45,13 @@ unix:INSTALLS += target config examples cacheexamples impexamples \
resexamples supplementary

include(./VERSION)
unix:dev=$$find(VERSION, "-dev")
unix:count(dev, 1) {
rev=$$system(git describe --always)
VERSION=$$replace(VERSION, "dev", $$rev)
}
DEFINES+=VERSION=\\\"$$VERSION\\\"
DEFINES+=PREFIX=\\\"$$PREFIX\\\"

CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT

Expand Down
36 changes: 27 additions & 9 deletions src/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@

void Cli::createParser(QCommandLineParser *parser, QString platforms) {

parser->setApplicationDescription(
StrTools::getVersionHeader() +
QString h =
"Skyscraper looks for compatible game files for the chosen platform "
"(set with '-p'). It allows you to gather and cache media and game "
"information for the files using various scraping modules (set with "
Expand All @@ -43,8 +42,28 @@ void Cli::createParser(QCommandLineParser *parser, QString platforms) {
"documentation at 'https://gemba.github.io/skyscraper/' for a "
"detailed explanation of all features.\n\nRemember that most of the "
"following options can also be set in the "
"'/home/<USER>/.skyscraper/config.ini' file. All cli options and "
"config.ini options are thoroughly documented at the above link.");
"'/home/<USER>/.skyscraper/config.ini' file. All command line options "
"and config.ini options are thoroughly documented at the above link.";

QString ht = "";
int csr = 0;
for (auto w : h.split(QRegExp("\\s"))) {
if (csr + w.length() >= 80 || w.isEmpty()) {
csr = 0;
ht.append('\n');
if (w.isEmpty()) {
ht.append("\n");
continue;
}
}
csr += w.length() + 1;
ht.append(w);
ht.append(' ');
}
ht.chop(1);

parser->setApplicationDescription(StrTools::getVersionHeader() + ht);

QCommandLineOption pOption(
"p",
"The platform you wish to scrape. Currently supports " + platforms +
Expand Down Expand Up @@ -114,11 +133,10 @@ void Cli::createParser(QCommandLineParser *parser, QString platforms) {
"artwork compositing when in gamelist generation mode. Default: "
"'/home/<USER>/.skyscraper/artwork.xml'",
"FILENAME", "");
QCommandLineOption dOption(
"d",
"Set custom resource cache folder. Default: "
"'/home/<USER>/.skyscraper/cache/PLATFORM'",
"FOLDER", "");
QCommandLineOption dOption("d",
"Set custom resource cache folder. Default: "
"'/home/<USER>/.skyscraper/cache/PLATFORM'",
"FOLDER", "");
QCommandLineOption addextOption(
"addext",
"Add this or these file extension(s) to accepted file extensions "
Expand Down
2 changes: 1 addition & 1 deletion src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void Config::setupUserConfig() {
QDir::setCurrent(skyDir.absolutePath());

// copy configs
QString localEtcPath = QString("/usr/local/etc/skyscraper/");
QString localEtcPath = QString(PREFIX "/etc/skyscraper/");

if (!QFileInfo::exists(localEtcPath)) {
// RetroPie installation type
Expand Down
2 changes: 1 addition & 1 deletion src/layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ bool Layer::hasLayers() {
bool Layer::save(QString filename) {
// Check if canvas is largely transparent. If so, don't save it
const QRgb *canvasBits = (QRgb *)canvas.constBits();
quint64 noOfPixels = canvas.width() * canvas.height();
quint64 noOfPixels = (quint64) canvas.width() * canvas.height();
bool transparent = true;
for (quint64 a = 0; a < noOfPixels; a = a + 10) {
if (qAlpha(canvasBits[a]) != 0) {
Expand Down
Loading

0 comments on commit 6ee541a

Please sign in to comment.