mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 15:11:58 +01:00
Compare commits
4
Commits
3bd29f75e6
...
29935b7bee
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29935b7bee | ||
|
|
4bfe67ec19 | ||
|
|
060a5f036f | ||
|
|
c169549ef4 |
@@ -50,5 +50,5 @@ jobs:
|
||||
- uses: actions/cache@v6
|
||||
with:
|
||||
path: .integration/music
|
||||
key: integration-music-v1
|
||||
key: integration-music-v3
|
||||
- run: nix develop .#integration --command nu tools/integration-test.nu
|
||||
|
||||
@@ -119,7 +119,7 @@ android {
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
getByName("debug").res.srcDir("src/nightly/res")
|
||||
getByName("debug").res.directories.add("src/nightly/res")
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
||||
+2
-2
@@ -56,7 +56,7 @@ class SubsonicSourceIntegrationTest(
|
||||
assertNotNull(kosmo.starred)
|
||||
assertTrue(kosmo.created <= System.currentTimeMillis() / 1000)
|
||||
|
||||
assertNull(albums.first { it.name == "Retroconnaissance EP" }.starred)
|
||||
assertNull(albums.first { it.name == "Retroconnaissance" }.starred)
|
||||
assertNull(albums.first { it.name == "I Don't Know What I'm Doing" }.starred)
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ class SubsonicSourceIntegrationTest(
|
||||
.filter { it.artistId == artists.first { a -> a.name == "Ugress" }.id }
|
||||
.map { it.name }
|
||||
.sorted()
|
||||
assertEquals(listOf("Kosmonaut", "Retroconnaissance EP"), ugressAlbums)
|
||||
assertEquals(listOf("Kosmonaut", "Retroconnaissance"), ugressAlbums)
|
||||
|
||||
val bradAlbums =
|
||||
albums
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ class SubsonicWriteIntegrationTest(
|
||||
.albums()
|
||||
.toList()
|
||||
.flatten()
|
||||
.first { it.name == "Retroconnaissance EP" }
|
||||
.first { it.name == "Retroconnaissance" }
|
||||
|
||||
source.setStar(StarType.Album, album.id, true)
|
||||
try {
|
||||
@@ -94,7 +94,7 @@ class SubsonicWriteIntegrationTest(
|
||||
.songs()
|
||||
.toList()
|
||||
.flatten()
|
||||
.first { it.album == "Retroconnaissance EP" }
|
||||
.first { it.album == "Retroconnaissance" }
|
||||
|
||||
source.setStar(StarType.Song, song.id, true)
|
||||
try {
|
||||
|
||||
@@ -93,7 +93,7 @@ class PruneSyncIntegrationTest {
|
||||
?: error("$name is not set; run the integration harness (tools/integration-test.nu)")
|
||||
|
||||
private companion object {
|
||||
const val REMOVED_ALBUM_DIR = "197"
|
||||
const val REMOVED_ALBUM_NAME = "Retroconnaissance EP"
|
||||
const val REMOVED_ALBUM_DIR = "7GZYpfn8wypaTR00LWeNI4"
|
||||
const val REMOVED_ALBUM_NAME = "Retroconnaissance"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@ pluginManagement {
|
||||
includeGroupByRegex("androidx.*")
|
||||
}
|
||||
}
|
||||
maven("https://maven-central.storage-download.googleapis.com/maven2/") {
|
||||
name = "MavenCentralMirror"
|
||||
}
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
@@ -16,6 +19,9 @@ dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
google()
|
||||
maven("https://maven-central.storage-download.googleapis.com/maven2/") {
|
||||
name = "MavenCentralMirror"
|
||||
}
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,11 +12,15 @@ export const LIB = ".integration/music"
|
||||
export const ports = [$NAV_PORT $GONIC_PORT $LMS_PORT $NC_PORT $PRUNE_PORT]
|
||||
|
||||
const MUSIC = [
|
||||
{ id: 197, name: "Ugress - Retroconnaissance EP", songs: 4 }
|
||||
{ id: 199, name: "Ugress - Kosmonaut", songs: 4 }
|
||||
{ id: 321, name: "Brad Sucks - I Don't Know What I'm Doing", songs: 12 }
|
||||
{ id: "7GZYpfn8wypaTR00LWeNI4", name: "Ugress - Retroconnaissance", songs: 4 }
|
||||
{ id: "5gMe1SlZZzuOMkRVWJaodV", name: "Ugress - Kosmonaut", songs: 4 }
|
||||
{ id: "0JnRLI5lo4eNU1pOePqfcG", name: "Brad Sucks - I Don't Know What I'm Doing", songs: 12 }
|
||||
]
|
||||
|
||||
const MUSIC_DOWNLOAD = "https://demo.navidrome.org/rest/download.view?u=demo&p=demo&v=1.16.1&c=subtracks-test&id="
|
||||
|
||||
const MUSIC_ART = "https://demo.navidrome.org/rest/getCoverArt.view?u=demo&p=demo&v=1.16.1&c=subtracks-test&id="
|
||||
|
||||
# Keep in step with TestServers.kt.
|
||||
export def test-servers [] {
|
||||
[
|
||||
@@ -33,17 +37,18 @@ def song-count [dir: string] {
|
||||
}
|
||||
|
||||
export def ensure-music [] {
|
||||
if ($MUSIC | all {|m| (song-count $"($LIB)/($m.id)") == $m.songs }) {
|
||||
if ($MUSIC | all {|m| (song-count $"($LIB)/($m.id)") == $m.songs and ($"($LIB)/($m.id)/folder.jpg" | path exists) }) {
|
||||
print $"using test music in ($LIB)"
|
||||
return
|
||||
}
|
||||
print "downloading test music from demo.subsonic.org (one-time)"
|
||||
print "downloading test music from demo.navidrome.org (one-time)"
|
||||
mkdir $LIB
|
||||
let tmp = (^mktemp -d | str trim)
|
||||
for m in $MUSIC {
|
||||
print $"($m.name)..."
|
||||
^curl -fsS -o $"($tmp)/($m.id).zip" $"http://demo.subsonic.org/rest/download.view?u=guest1&p=guest&v=1.13.0&c=subtracks-test&id=($m.id)"
|
||||
^unzip -q -o $"($tmp)/($m.id).zip" -d $"($LIB)/($m.id)"
|
||||
^curl -fsS -o $"($tmp)/($m.id).zip" $"($MUSIC_DOWNLOAD)($m.id)"
|
||||
^unzip -j -q -o $"($tmp)/($m.id).zip" -d $"($LIB)/($m.id)"
|
||||
^curl -fsS -o $"($LIB)/($m.id)/folder.jpg" $"($MUSIC_ART)($m.id)"
|
||||
}
|
||||
rm -rf $tmp
|
||||
}
|
||||
@@ -163,8 +168,9 @@ export def start-prune [work: string] {
|
||||
let music = ($dir | path join "music")
|
||||
mkdir ($dir | path join "data")
|
||||
mkdir $music
|
||||
^cp -r $"((pwd) | path join $LIB)/197" $music
|
||||
^cp -r $"((pwd) | path join $LIB)/199" $music
|
||||
for m in ($MUSIC | first 2) {
|
||||
^cp -r $"((pwd) | path join $LIB)/($m.id)" $music
|
||||
}
|
||||
|
||||
let daemon = (job spawn { ^navidrome --address 127.0.0.1 --port $PRUNE_PORT --musicfolder $music --datafolder ($dir | path join "data") --loglevel warn out+err> ($dir | path join "navidrome.log") })
|
||||
let ready = (try {
|
||||
@@ -198,12 +204,12 @@ export def prepare-fixtures [server: record] {
|
||||
|
||||
let albums = (poll "albums" {||
|
||||
let items = (sub-get $base $user $pass "getAlbumList2" [["type" "newest"]] | get albumList2.album)
|
||||
if (["Kosmonaut" "Retroconnaissance EP" "I Don't Know What I'm Doing"] | all {|name| $items | any {|i| $i.name == $name } }) { $items } else { null }
|
||||
if (["Kosmonaut" "Retroconnaissance" "I Don't Know What I'm Doing"] | all {|name| $items | any {|i| $i.name == $name } }) { $items } else { null }
|
||||
})
|
||||
|
||||
let ugress = (named-id $artists "Ugress")
|
||||
let kosmo = (named-id $albums "Kosmonaut")
|
||||
let retro = (named-id $albums "Retroconnaissance EP")
|
||||
let retro = (named-id $albums "Retroconnaissance")
|
||||
let dunno = (named-id $albums "I Don't Know What I'm Doing")
|
||||
|
||||
poll "album songs" {||
|
||||
|
||||
Reference in New Issue
Block a user