From 8250e347a8749dcfa60f496acafcd28858e460a1 Mon Sep 17 00:00:00 2001 From: torkus <48790775+torkus@users.noreply.github.com> Date: Sun, 24 Dec 2023 15:51:43 +1030 Subject: [PATCH] 7.2.0 (#422) * 7.2.0 --- .circleci/config.yml | 2 +- AppImage/AppRun | 6 - AppImage/strongbox.desktop | 12 -- CHANGELOG.md | 27 ++++ Dockerfile => CircleCI/Dockerfile | 4 +- .../Dockerfile.buster | 4 +- TODO.md | 52 ++------ build-linux-image.sh | 63 --------- lint.sh | 13 -- manage.sh | 126 ++++++++++++++++++ pom.xml | 4 +- project.clj | 2 +- release.sh | 19 --- run-tests.sh | 34 ----- src/strongbox/addon.clj | 3 +- src/strongbox/core.clj | 12 +- src/strongbox/jfx.clj | 2 +- src/strongbox/specs.clj | 3 +- src/strongbox/toc.clj | 25 ++-- .../fixtures/everyaddon--1-2-3--multi-toc.zip | Bin 2496 -> 2860 bytes test/strongbox/toc_test.clj | 54 +++++--- update-test-fixtures.sh | 58 -------- 22 files changed, 237 insertions(+), 288 deletions(-) delete mode 100755 AppImage/AppRun delete mode 100644 AppImage/strongbox.desktop rename Dockerfile => CircleCI/Dockerfile (84%) rename Dockerfile.buster => CircleCI/Dockerfile.buster (82%) delete mode 100755 build-linux-image.sh delete mode 100755 lint.sh create mode 100755 manage.sh delete mode 100755 release.sh delete mode 100755 run-tests.sh delete mode 100755 update-test-fixtures.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index f86b6272..5a9d6e27 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,4 +44,4 @@ jobs: key: v1-dependencies-{{ checksum "project.clj" }} # run tests! - - run: ./run-tests.sh + - run: ./manage.sh test diff --git a/AppImage/AppRun b/AppImage/AppRun deleted file mode 100755 index 113c003e..00000000 --- a/AppImage/AppRun +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -# uses a custom modular JRE to run the application uberjar -set -e -DIR="$(dirname "$(readlink -f "$0")")" -cd $DIR -./usr/bin/java -jar ./usr/app.jar "$@" diff --git a/AppImage/strongbox.desktop b/AppImage/strongbox.desktop deleted file mode 100644 index 59df46ff..00000000 --- a/AppImage/strongbox.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -# https://specifications.freedesktop.org/desktop-entry-spec/1.0/ -Type=Application -Version=1.0 -Name=Strongbox -GenericName=addon manager -Comment=World of Warcraft addon manager -Exec=AppRun -Terminal=false -Categories=Game;PackageManager;Java; -Icon=strongbox -Keywords=warcraft;wow;world of warcraft;elvui;tukui;wowinterface;github; diff --git a/CHANGELOG.md b/CHANGELOG.md index 37bdd70a..f688857a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,33 @@ All notable changes to this project will be documented in this file. This change The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 7.2.0 - 2023-12-24 + +### Added + +* `x-website` Github URLs in `.toc` files are now treated as a Github source that an addon can be switched to. + - when both `x-github` and Github `x-website` sources exist, `x-github` takes priority. + +### Changed + +* moved AppImage building to `ogri-la/strongbox-appimage`. +* consolidated all the `.sh` into a single `manage.sh` script. + - `lint.sh` moved to `manage.sh` as command 'lint'. + - `run-tests.sh` moved to `manage.sh` as command 'test'. + - `update-test-fixtures.sh` moved to `manage.sh` as command 'update-test-fixtures'. + - `build-linx-image.sh` moved to `ogri-la/strongbox-appimage` as `build-appimage.sh`. + +### Fixed + +* fixed bug preventing classic Wrath `.toc` from being detected and loaded. +* fixed bug in catalogue location spec where a value that should have been validating as a URL was not. +* removed `x-tukui-id` source detection in `.toc` files. Tukui no longer hosts addons so these can't be used. + - overlooked, should have been part of 7.0.0 major version. + +### Removed + +* removed `release.sh` as it had been unused for several years. + ## 7.1.0 - 2023-11-26 ### Added diff --git a/Dockerfile b/CircleCI/Dockerfile similarity index 84% rename from Dockerfile rename to CircleCI/Dockerfile index e089d36e..282c3c11 100644 --- a/Dockerfile +++ b/CircleCI/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /home/user RUN mkdir strongbox COPY src strongbox/src COPY test strongbox/test -COPY cloverage.clj run-tests.sh project.clj strongbox/ +COPY cloverage.clj manage.sh project.clj strongbox/ RUN chown -R user:user strongbox/ USER user @@ -18,4 +18,4 @@ WORKDIR /home/user/strongbox RUN lein deps && lein cloverage -h > /dev/null -RUN ./run-tests.sh +RUN ./manage.sh test diff --git a/Dockerfile.buster b/CircleCI/Dockerfile.buster similarity index 82% rename from Dockerfile.buster rename to CircleCI/Dockerfile.buster index 7e89574b..31eb9eb7 100644 --- a/Dockerfile.buster +++ b/CircleCI/Dockerfile.buster @@ -6,7 +6,7 @@ USER root RUN mkdir strongbox COPY src strongbox/src COPY test strongbox/test -COPY cloverage.clj run-tests.sh project.clj strongbox/ +COPY cloverage.clj manage.sh project.clj strongbox/ RUN chown circleci:circleci -R strongbox USER circleci @@ -16,4 +16,4 @@ WORKDIR strongbox RUN sudo apt install libgtk-3-0 libxtst6 --no-install-recommends RUN lein deps && lein cloverage -h > /dev/null -RUN ./run-tests.sh +RUN ./manage.sh test diff --git a/TODO.md b/TODO.md index f8dbbe31..1c5dd7a3 100644 --- a/TODO.md +++ b/TODO.md @@ -6,53 +6,25 @@ see CHANGELOG.md for a more formal list of changes by release ## done -* search, possible bug, thought I fixed it so catalogues are navigable now? - - selecting by host still gives me samples - - done - -* search, add ability to browse catalogue page by page - - returned to bucket 2022-03-02 - - the 'search' tab kinda sorta is this ... perhaps a preference to disable sampling? - - done - -* search, vertically centre tag buttons. - - they're currently top-aligned - - done - -* cljfx, javafx - - bump deps - -* support NO_COLOR envvar, http://no-color.org - - done - -* rawdata, interface-version is being localised - - done - -* gui, better copying from the interface, especially the log box - - too much faff and bs for selectable text/labels, wontdo. - - added selectable plain text and json boxes to the raw text widgets - - done - -* add a disable update check cli arg - - flatpaks will check for updates in a different way - - done - -* github-addons.md, update or get rid of - - got rid of it +* move Dockerfile* files into a CircleCI folder - done -* release.md, move to strongbox-release-script +* toc, what is the usage of 'x-github'. we're expecting a url but a foo/bar seems fine as well + - check the github catalogue + - I'm seeing more usage of 'x-website' - done -* gui, raw data, add textual versions of this data as well - - pretty printing in a gui is one thing, but useless if it can't be copied - - have a text field with plain text and yaml or json formatted addon data could be useful as well +* *.sh, consolidate these root-level bash scripts into a manage.sh - done ## todo ## todo bucket (no particular order) +* cataclysm classic support + +* nfo, replace the URL as the group-id with something random + * github, catalogue, no download counts. * github, catalogue, add any tags if they exist @@ -80,10 +52,6 @@ see CHANGELOG.md for a more formal list of changes by release - 'tukui' in the search results shouldn't mean 'ogri-la/tukui' if 'tukui.org/tukui' is also available - which it isn't, but that's not the point. -* *.sh, consolidate these root-level bash scripts into a manage.sh - -* move Dockerfile* files into a CircleCI folder - * metrics, add a 'catalogue is N days old' - add an 'oldest' addon (days since created date)? - add a 'most stale' addon (days since last update)? @@ -114,6 +82,7 @@ see CHANGELOG.md for a more formal list of changes by release * gui, 'set-icon' is taking a long time to do it's thing. + * manually select the primary addon in a group of addons to prevent synthetic titles * http, add with-backoff support to download-file @@ -239,7 +208,6 @@ see CHANGELOG.md for a more formal list of changes by release * preference for 'fat rows' - increase the padding for each row a bit -* nfo, replace the URL as the group-id with something random * "developer warnings" - a preference that bumps certain debug messages to warnings and errors for developers diff --git a/build-linux-image.sh b/build-linux-image.sh deleted file mode 100755 index 6736a41e..00000000 --- a/build-linux-image.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# creates a custom JRE and self-contained launcher for application using AppImage -set -e - -output_dir="custom-jre" -rm -rf "./$output_dir" - -echo "--- building custom JRE ---" - -# compress=1 'constant string sharing' compresses better with AppImage than compress=2 'zip', 52MB -> 45MB -# - https://docs.oracle.com/en/java/javase/19/docs/specs/man/jlink.html#plugin-compress -jlink \ - --add-modules "java.sql,java.naming,java.desktop,jdk.unsupported,jdk.crypto.ec" \ - --output "$output_dir" \ - --strip-debug \ - --no-man-pages \ - --no-header-files \ - --compress=1 - -# needed when built using Ubuntu as libjvm.so is *huge* -# doesn't seem to hurt to strip the other .so files. -find -name "*.so" | xargs strip --preserve-dates --strip-unneeded - -du -sh "$output_dir" - -echo -echo "--- building app ---" -lein clean -rm -f resources/full-catalogue.json -wget https://raw.githubusercontent.com/ogri-la/strongbox-catalogue/master/full-catalogue.json \ - --quiet \ - --directory-prefix resources -lein uberjar - -cp ./target/*-standalone.jar "$output_dir/app.jar" - -echo -echo "--- building AppImage ---" -if [ ! -e appimagetool ]; then - wget \ - -c "https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage" \ - -o appimagetool - mv appimagetool-x86_64.AppImage appimagetool - chmod +x appimagetool -fi -rm -rf ./AppDir -mkdir AppDir -mv "$output_dir" AppDir/usr -cp AppImage/strongbox.desktop AppDir/ -cp resources/strongbox.svg resources/strongbox.png AppDir/ -cp AppImage/AppRun AppDir/ -du -sh AppDir/ -rm -f strongbox.appimage # safer than 'rm -f strongbox' -ARCH=x86_64 ./appimagetool AppDir/ strongbox.appimage -mv strongbox.appimage strongbox -du -sh strongbox - -echo -echo "--- cleaning up ---" -rm -rf AppDir - -echo -echo "done." diff --git a/lint.sh b/lint.sh deleted file mode 100755 index 799d5eb3..00000000 --- a/lint.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -set -e - -if which joker > /dev/null; then - echo "joker lint" - joker --lint --working-dir ./ -fi - -echo "cljfmt lint" -lein cljfmt fix - -echo "eastwood lint" -lein eastwood diff --git a/manage.sh b/manage.sh new file mode 100755 index 00000000..b727ac40 --- /dev/null +++ b/manage.sh @@ -0,0 +1,126 @@ +#!/bin/bash +set -eu -o pipefail + +cmd="$1" + +if test ! "$cmd"; then + echo "command required." + echo + echo "available commands:" + echo " update-deps update project dependencies" + echo " test run application tests" + echo " lint run linters" + echo " update-test-fixtures update static files used during testing" + exit 1 +fi + +shift +rest=$* + +if test "$cmd" = "update-deps"; then + lein ancient + exit 0 + +elif test "$cmd" = "test"; then + # always ratchet *upwards* + fail_threshold=80 + # this file can't live in src/strongbox because lein-cloverage can't be found during dev. + # so we copy it in and destroy it afterwards + cp cloverage.clj src/strongbox/cloverage.clj + rm -rf ./coverage/ # any coverage reports from previous run + + function finish { + rm src/strongbox/cloverage.clj + + # 'lein clean' wipes out the 'target' directory, including the Cloverage report + if [ -d target/coverage ]; then + echo + echo "wrote coverage/index.html" + mv target/coverage coverage + fi + lein clean + } + trap finish EXIT + if which xvfb-run; then + # CI + xvfb-run lein cloverage --runner "strongbox" + else + # dev + lein cloverage --runner "strongbox" --fail-threshold "$fail_threshold" --html + fi + exit 0 + +elif test "$cmd" = "lint"; then + if which joker > /dev/null; then + echo "joker lint" + joker --lint --working-dir ./ + fi + echo "cljfmt lint" + lein cljfmt fix + echo "eastwood lint" + lein eastwood + exit 0 + +elif test "$cmd" = "update-test-fixtures"; then + # downloads new test fixtures + function dl { + url="$1" + fname="$2" + if [[ "$fname" == *json ]]; then + curl --silent "$url" | jq . > "test/fixtures/$fname" + else + curl --silent "$url" > "test/fixtures/$fname" + fi + echo "$fname" + } + + # curseforge + dl "https://www.curseforge.com/wow/addons?filter-sort=name&page=1" "curseforge-addon-summary-listing.html" + + # curseforge api + dl "https://addons-ecs.forgesvc.net/api/v2/addon/327019" "curseforge-api-addon--everyaddon.json" + cp "test/fixtures/curseforge-api-addon--everyaddon.json" "test/fixtures/curseforge-api-addon--everyotheraddon.json" + ## one search result + dl "https://addons-ecs.forgesvc.net/api/v2/addon/search?gameId=1&index=0&pageSize=1&searchFilter=&sort=2" "curseforge-api-search--truncated.json" + + # wowinterface + dl "https://wowinterface.com/addons.php" "wowinterface-category-list.html" + dl "https://www.wowinterface.com/downloads/cat19.html" "wowinterface-category-page.html" + dl "https://www.wowinterface.com/downloads/info9085-Dominos.html" "wowinterface-addon-page.html" + + # wowinterface api + dl "https://api.mmoui.com/v3/game/WOW/filelist.json" "wowinterface-api--complete.json" + dl "https://api.mmoui.com/v3/game/WOW/filedetails/25122.json" "wowinterface-api--addon-details.json" + dl "https://api.mmoui.com/v3/game/WOW/filedetails/24910.json" "wowinterface-api--addon-details-classic.json" # WeakAuras2 + + # github api + dl "https://api.github.com/repos/Robert388/Necrosis-classic/releases" "github-repo-releases--no-assets.json" + dl "https://api.github.com/repos/jsb/RingMenu/releases" "github-repo-releases--single-asset-classic.json" + dl "https://api.github.com/repos/jsb/RingMenu/releases" "github-repo-releases--broken-assets.json" + dl "https://api.github.com/repos/Ravendwyr/Chinchilla/releases" "github-repo-releases--many-assets-many-gametracks.json" + dl "https://api.github.com/repos/Ravendwyr/Chinchilla/contents" "github-repo-contents--many-assets-many-gametracks.json" + + # gitlab api + dl "https://gitlab.com/api/v4/projects/woblight%2Fnitro" "gitlab-repo--woblight-nitro.json" + dl "https://gitlab.com/api/v4/projects/woblight%2Fnitro/releases" "gitlab-repo-releases--woblight-nitro.json" + dl "https://gitlab.com/api/v4/projects/woblight%2Fnitro/repository/tree" "gitlab-repo-tree--woblight-nitro.json" + dl "https://gitlab.com/api/v4/projects/thing-engineering%2Fwowthing%2Fwowthing-collector/repository/blobs/125c899d813d2e11c976879f28dccc2a36fd207b" "gitlab-repo-blobs--wowthing.json" + dl "https://gitlab.com/api/v4/projects/woblight%2Fnitro/repository/tree" "gitlab-repo-tree--woblight-nitro.json" + + # tukui api + dl "https://www.tukui.org/api.php?addon=98" "tukui--addon-details.json" + dl "https://www.tukui.org/api.php?classic-addon=13" "tukui--classic-addon-details.json" + dl "https://www.tukui.org/api.php?ui=tukui" "tukui--tukui-addon-proper.json" + dl "https://www.tukui.org/api.php?ui=elvui" "tukui--elvui-addon-proper.json" + + # user-catalogue + dl "https://api.github.com/repos/Stanzilla/AdvancedInterfaceOptions/releases" "user-catalogue--github.json" + + exit 0 + +# ... + +fi + +echo "unknown command: $cmd" +exit 1 diff --git a/pom.xml b/pom.xml index 40ef8ae5..87a19d37 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ ogri-la strongbox jar - 7.1.0 + 7.2.0 strongbox World Of Warcraft Addon Manager https://github.com/ogri-la/strongbox @@ -18,7 +18,7 @@ https://github.com/ogri-la/strongbox scm:git:git://github.com/ogri-la/strongbox.git scm:git:ssh://git@github.com/ogri-la/strongbox.git - 6c19eaf4f3c5496aa9570b6839bf810f7d83243a + b576cac556bd51217f1d0f1e5499c1a18a6c25e3 src diff --git a/project.clj b/project.clj index 3b5064a0..fd061bed 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject ogri-la/strongbox "7.1.0" +(defproject ogri-la/strongbox "7.2.0" :description "World Of Warcraft Addon Manager" :url "https://github.com/ogri-la/strongbox" :license {:name "GNU Affero General Public License (AGPL)" diff --git a/release.sh b/release.sh deleted file mode 100755 index 218a5d42..00000000 --- a/release.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# called by Travis CI via the .travis.yml file -set -e - -lein clean -# generates a file like: -# ./target/strongbox-1.1.1-standalone.jar -lein uberjar -( - cd target - filepath=$(realpath strongbox-*-standalone.jar | head -n 1) - filename=$(basename "$filepath") - sha256sum strongbox-*-standalone.jar > "$filename.sha256" -) - -# generates an AppImage called 'strongbox' -. build-linux-image.sh -sha256sum strongbox > "target/strongbox.sha256" -mv strongbox target/strongbox diff --git a/run-tests.sh b/run-tests.sh deleted file mode 100755 index 8887de06..00000000 --- a/run-tests.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -set -e - -# always ratchet *upwards* -fail_threshold=80 - -# this file can't live in src/strongbox because lein-cloverage can't be found during dev. -# so we copy it in and destroy it afterwards -cp cloverage.clj src/strongbox/cloverage.clj - -# any coverage reports from previous run -rm -rf ./coverage/ - -function finish { - rm src/strongbox/cloverage.clj - - # 'lein clean' wipes out the 'target' directory, including the Cloverage report - if [ -d target/coverage ]; then - echo - echo "wrote coverage/index.html" - mv target/coverage coverage - fi - - lein clean -} -trap finish EXIT - -if which xvfb-run; then - # CI - xvfb-run lein cloverage --runner "strongbox" -else - # dev - lein cloverage --runner "strongbox" --fail-threshold "$fail_threshold" --html -fi diff --git a/src/strongbox/addon.clj b/src/strongbox/addon.clj index d8728e7b..7afd5c09 100644 --- a/src/strongbox/addon.clj +++ b/src/strongbox/addon.clj @@ -210,7 +210,8 @@ group-addons)) (defn-spec load-installed-addon (s/or :ok-toc :addon/toc, :ok-nfo :addon/nfo, :error nil?) - "reads and merges the toc data and the nfo data from a specific `addon-dir` and all those in it's group, groups them up (again) and returns the grouped mooshed data. + "reads and merges the toc data and the nfo data for a specific addon at `addon-dir` (bad name) and all those in it's group, + groups them up (again) and returns the grouped mooshed data. this was introduced much later than `load-all-installed-addons` as parallel installation and loading of addons was introduced." [addon-dir ::sp/addon-dir, game-track ::sp/game-track] (logging/with-addon {:dirname (-> addon-dir fs/base-name str)} diff --git a/src/strongbox/core.clj b/src/strongbox/core.clj index 447ca912..b9a5343e 100644 --- a/src/strongbox/core.clj +++ b/src/strongbox/core.clj @@ -1682,19 +1682,19 @@ ;; load the user-catalogue. `db-load-catalogue` will incorporate this if it's found. (db-load-user-catalogue) - ;; load the contents of the selected catalogue and the user catalogue + ;; load the contents of the selected catalogue and the user catalogue (db-load-catalogue) - ;; match installed addons to those in catalogue + ;; match installed addons to those in catalogue (match-all-installed-addons-with-catalogue) - ;; for those addons that have matches, download their details + ;; for those addons that have matches, download their details (check-for-updates) - ;; 2019-06-30, travis is failing with 403: Forbidden. Moved to gui init - ;;(latest-strongbox-release) ;; check for updates after everything else is done + ;; 2019-06-30, travis is failing with 403: Forbidden. Moved to gui init + ;;(latest-strongbox-release) ;; check for updates after everything else is done - ;; seems like a good place to preserve the etag-db + ;; seems like a good place to preserve the etag-db (save-settings!) (scheduled-user-catalogue-refresh) diff --git a/src/strongbox/jfx.clj b/src/strongbox/jfx.clj index 2f269b09..fb697178 100644 --- a/src/strongbox/jfx.clj +++ b/src/strongbox/jfx.clj @@ -2915,7 +2915,7 @@ _ (swap! core/state assoc :disable-gui (fn [] (fx/unmount-renderer gui-state renderer) ;; the slightest of delays allows any final rendering to happen before the exit-handler is called. - ;; only affects testing from the repl apparently and not `./run-tests.sh` + ;; only affects testing from the repl apparently and not `./manage.sh test` (Thread/sleep 25))) ;; on first load, because the catalogue hasn't been loaded diff --git a/src/strongbox/specs.clj b/src/strongbox/specs.clj index 433bc9fb..befe7a57 100644 --- a/src/strongbox/specs.clj +++ b/src/strongbox/specs.clj @@ -451,9 +451,10 @@ ;; catalogue locations (s/def :catalogue/name keyword?) +(s/def :catalogue/source ::url) ;; a `catalogue/location` is a description of a catalogue and where to find it, not the catalogue itself. -(s/def :catalogue/location (s/keys :req-un [:catalogue/name ::label :addon/source])) +(s/def :catalogue/location (s/keys :req-un [:catalogue/name ::label :catalogue/source])) (s/def :catalogue/location-list (s/or :ok (s/coll-of :catalogue/location) :empty ::empty-coll)) diff --git a/src/strongbox/toc.clj b/src/strongbox/toc.clj index d713347d..76754fec 100644 --- a/src/strongbox/toc.clj +++ b/src/strongbox/toc.clj @@ -54,7 +54,7 @@ "returns a list of file names as `[[game-track, filename.toc], ...]` in the given `addon-dir`. `game-track` is `nil` if it can't be guessed from the filename (and not 'retail')." [addon-dir ::sp/extant-dir] - (let [pattern (Pattern/compile "(?u)^(.+?)(?:[\\-_]{1}(Mainline|Classic|Vanilla|TBC|BCC){1})?\\.toc$") + (let [pattern (Pattern/compile "(?u)^(.+?)(?:[\\-_]{1}(Mainline|Classic|Vanilla|TBC|BCC|Wrath){1})?\\.toc$") matching-toc-pattern (fn [filename] (let [toc-bname (str (fs/base-name filename)) [toc-bname-match game-track-match] (rest (re-matches pattern toc-bname))] @@ -121,16 +121,22 @@ ;; {:source "curseforge" ;; :source-id x-curse-id}) - tukui-source (when-let [x-tukui-id (-> keyvals :x-tukui-projectid utils/to-int)] - {:source "tukui" - :source-id x-tukui-id}) + ;;tukui-source (when-let [x-tukui-id (-> keyvals :x-tukui-projectid utils/to-int)] + ;; {:source "tukui" + ;; :source-id x-tukui-id}) github-source (when-let [x-github (-> keyvals :x-github)] {:source "github" :source-id (utils/github-url-to-source-id x-github)}) - source-map-list (when-let [items (->> [wowi-source tukui-source github-source - ;;curse-source + github-website-source (when-let [x-website (-> keyvals :x-website)] + (when (and (not github-source) + (.startsWith x-website "https://github.com")) + {:source "github" + :source-id (utils/github-url-to-source-id x-website)})) + + source-map-list (when-let [items (->> [wowi-source github-source github-website-source + ;;curse-source tukui-source ] utils/items utils/nilable)] @@ -177,10 +183,11 @@ (assoc addon :dirsize dirsize) addon) - ;; prefers tukui over wowi, wowi over github. I'd like to prefer github over wowi, but github - ;; requires API calls to interact with and these are limited unless authenticated. + ;; prefers wowi over github and github over github-via-website. + ;; I'd like to prefer github over wowi, but github requires API calls to interact with and these are limited unless authenticated. addon (merge addon - github-source wowi-source tukui-source + github-website-source github-source wowi-source + ;; curse-source tukui-source ignore-flag source-map-list)] (if-not (s/valid? :addon/toc addon) diff --git a/test/fixtures/everyaddon--1-2-3--multi-toc.zip b/test/fixtures/everyaddon--1-2-3--multi-toc.zip index 779c1dafff1b6bda52cafebdb7e5f922a7f21afe..8f7fd37703112070569aa359a212c6d2c1deb038 100644 GIT binary patch delta 336 zcmX>gyhdz;1gp3RGXnz$!@((2!!_S(UEjyRz@W&;z#u=_kVTR;yeP3GV{#yiNPWgz zP4m;+F2r$dt(bc8%q)i!FH*uj-j`-SxL5VOwfvbJw)>HuY&H{`uRf~Xm@~WUe_(Ly zdG3?BZ*9{f%JT1?+NA5*Ip=Q6wZ&{=?DjH7UwqnZr#2s%9F=>N>3Rd#%tq4*47Xz9 zn=Pk^^gCYWt&w39I`#FhjM0M`C5u-)X)t=HFI?&U?}d$<;{D4jEew8bO`Xx>V^*QK z-?g)UpOJ0G_oFuRYwQDVEz6C&v{dl+Grr9ttjCyfdhH{JnyxO`Z+a#9$y^KyKu "test/fixtures/$fname" - else - curl --silent "$url" > "test/fixtures/$fname" - fi - echo "$fname" -} - -# curseforge -dl "https://www.curseforge.com/wow/addons?filter-sort=name&page=1" "curseforge-addon-summary-listing.html" - -# curseforge api -dl "https://addons-ecs.forgesvc.net/api/v2/addon/327019" "curseforge-api-addon--everyaddon.json" -cp "test/fixtures/curseforge-api-addon--everyaddon.json" "test/fixtures/curseforge-api-addon--everyotheraddon.json" -## one search result -dl "https://addons-ecs.forgesvc.net/api/v2/addon/search?gameId=1&index=0&pageSize=1&searchFilter=&sort=2" "curseforge-api-search--truncated.json" - -# wowinterface -dl "https://wowinterface.com/addons.php" "wowinterface-category-list.html" -dl "https://www.wowinterface.com/downloads/cat19.html" "wowinterface-category-page.html" -dl "https://www.wowinterface.com/downloads/info9085-Dominos.html" "wowinterface-addon-page.html" - -# wowinterface api -dl "https://api.mmoui.com/v3/game/WOW/filelist.json" "wowinterface-api--complete.json" -dl "https://api.mmoui.com/v3/game/WOW/filedetails/25122.json" "wowinterface-api--addon-details.json" -dl "https://api.mmoui.com/v3/game/WOW/filedetails/24910.json" "wowinterface-api--addon-details-classic.json" # WeakAuras2 - -# github api -dl "https://api.github.com/repos/Robert388/Necrosis-classic/releases" "github-repo-releases--no-assets.json" -dl "https://api.github.com/repos/jsb/RingMenu/releases" "github-repo-releases--single-asset-classic.json" -dl "https://api.github.com/repos/jsb/RingMenu/releases" "github-repo-releases--broken-assets.json" -dl "https://api.github.com/repos/Ravendwyr/Chinchilla/releases" "github-repo-releases--many-assets-many-gametracks.json" -dl "https://api.github.com/repos/Ravendwyr/Chinchilla/contents" "github-repo-contents--many-assets-many-gametracks.json" - -# gitlab api -dl "https://gitlab.com/api/v4/projects/woblight%2Fnitro" "gitlab-repo--woblight-nitro.json" -dl "https://gitlab.com/api/v4/projects/woblight%2Fnitro/releases" "gitlab-repo-releases--woblight-nitro.json" -dl "https://gitlab.com/api/v4/projects/woblight%2Fnitro/repository/tree" "gitlab-repo-tree--woblight-nitro.json" -dl "https://gitlab.com/api/v4/projects/thing-engineering%2Fwowthing%2Fwowthing-collector/repository/blobs/125c899d813d2e11c976879f28dccc2a36fd207b" "gitlab-repo-blobs--wowthing.json" -dl "https://gitlab.com/api/v4/projects/woblight%2Fnitro/repository/tree" "gitlab-repo-tree--woblight-nitro.json" - -# tukui api -dl "https://www.tukui.org/api.php?addon=98" "tukui--addon-details.json" -dl "https://www.tukui.org/api.php?classic-addon=13" "tukui--classic-addon-details.json" -dl "https://www.tukui.org/api.php?ui=tukui" "tukui--tukui-addon-proper.json" -dl "https://www.tukui.org/api.php?ui=elvui" "tukui--elvui-addon-proper.json" - -# user-catalogue -dl "https://api.github.com/repos/Stanzilla/AdvancedInterfaceOptions/releases" "user-catalogue--github.json" -