A scene music post's 00- files go with its tracks
"[01/13] - "00-ammar-turk_uit_de_kroeg-single-web-nl-2022-cover.jpg"" with "[05/13] - "01-ammar-turk_uit_de_kroeg.mp3"": the tracks are keyed by artist and total (SCENE_TRACK), but the cover, nfo, sfv and m3u were releases of their own (2,630 single files of Meow in a.b.ftn). Under a bare counter a 00- stem takes the same key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f6e54b6c58
commit
7b99cfdb0e
3 files changed
+27
No files matched your search
@@ -712,6 +712,16 @@ pub fn release_identity(poster: &str, subject: &str, name: &str) -> Release {
|
||||
return Release { key: hash(&["post", poster, &remainder, &total.to_string()]), name: remainder, source: "post", file_total };
|
||||
}
|
||||
}
|
||||
// A scene music post's index files ("00-ammar-turk_uit_de_kroeg-single-web-nl-2022-cover.jpg") under a bare counter go
|
||||
// with its tracks: the artist and the total.
|
||||
if let Some(total) = post_total.filter(|&n| n != 0) {
|
||||
if stem.len() > 2 && stem.starts_with("00") && matches!(stem.as_bytes()[2], b'-' | b'_' | b' ' | b'.') {
|
||||
if let Some(c) = SCENE_TRACK.captures(stem.as_bytes()) {
|
||||
let artist = String::from_utf8(c[1].to_vec()).unwrap();
|
||||
return Release { key: hash(&["stem", poster, &artist, &total.to_string()]), name: artist, source: "stem", file_total };
|
||||
}
|
||||
}
|
||||
}
|
||||
if image {
|
||||
// Keyed by its set when its name has one ("diana-040-001.jpg").
|
||||
let name = if prefix.is_empty() { stem.clone() } else { prefix.clone() };
|
||||
@@ -1419,6 +1429,12 @@ mod image_set_tests {
|
||||
assert_eq!(track("06", "02-repiet_-_dont_think_twice_(extended_mix).mp3").key, track("07", "03-repiet_-_other_song.mp3").key);
|
||||
assert_eq!(track("06", "02-repiet_-_dont_think_twice_(extended_mix).mp3").name, "repiet");
|
||||
assert_eq!(track("01", "01-2bm_mq-real_rap_(intro).mp3").name, "2bm_mq");
|
||||
let meow = |i: &str, n: &str| release_identity("p", &format!(r#"[{i}/13] - "{n}" yEnc"#), n);
|
||||
let tracks = meow("05", "01-ammar-turk_uit_de_kroeg.mp3").key;
|
||||
for n in ["00-ammar-turk_uit_de_kroeg-single-web-nl-2022-cover.jpg", "00-ammar-turk_uit_de_kroeg-single-web-nl-2022.nfo", "00-ammar-turk_uit_de_kroeg-single-web-nl-2022.sfv"] {
|
||||
assert_eq!(meow("01", n).key, tracks, "{n}");
|
||||
}
|
||||
assert_ne!(meow("01", "00-frank_van_etten-wie_heeft_jouw_lach_gestolen-single-web-nl-2022-cover.jpg").key, tracks);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -370,6 +370,11 @@ export function releaseIdentity(input: ReleaseInput): ReleaseIdentity | null {
|
||||
if (!tag && postTotal && isPostToken(remainder)) {
|
||||
return { key: hash('post', poster, remainder, postTotal), name: remainder, fileTotal, source: 'post' }
|
||||
}
|
||||
// A scene music post's index files under a bare counter go with its tracks: the artist and the total ("[01/13] -
|
||||
// "00-ammar-turk_uit_de_kroeg-single-web-nl-2022-cover.jpg"" with "[05/13] - "01-ammar-turk_uit_de_kroeg.mp3"": the
|
||||
// cover, nfo, sfv and m3u of 2,600 Meow posts were releases of their own; LOG.md 2026-10-12 (28)).
|
||||
const sceneIndex = postTotal && /^00[-_ .]/.test(stem) ? SCENE_TRACK.exec(stem) : null
|
||||
if (sceneIndex) return { key: hash('stem', poster, sceneIndex[1], postTotal), name: sceneIndex[1], fileTotal, source: 'stem' }
|
||||
// An image without words around it: its set by its name (keyed as a stem, so "x.jpg" joins "x.part01.rar").
|
||||
// Keyed by its set when its name has one ("##[ "diana-040-001.jpg" (01/68)": all of a poster's 263 diana sets were
|
||||
// one release of 17,808 images; LOG.md 2026-10-12 (7)).
|
||||
|
||||
@@ -344,6 +344,12 @@ test.group('release / par2 names', () => {
|
||||
assert.equal(track('06', '02-repiet_-_dont_think_twice_(extended_mix).mp3').key, track('07', '03-repiet_-_other_song.mp3').key)
|
||||
assert.equal(track('06', '02-repiet_-_dont_think_twice_(extended_mix).mp3').name, 'repiet')
|
||||
assert.equal(track('01', '01-2bm_mq-real_rap_(intro).mp3').name, '2bm_mq')
|
||||
const meow = (i: string, n: string) => id(`[${i}/13] - "${n}" yEnc`, n)
|
||||
const tracks = meow('05', '01-ammar-turk_uit_de_kroeg.mp3').key
|
||||
for (const n of ['00-ammar-turk_uit_de_kroeg-single-web-nl-2022-cover.jpg', '00-ammar-turk_uit_de_kroeg-single-web-nl-2022.nfo', '00-ammar-turk_uit_de_kroeg-single-web-nl-2022.sfv']) {
|
||||
assert.equal(meow('01', n).key, tracks, n)
|
||||
}
|
||||
assert.notEqual(meow('01', '00-frank_van_etten-wie_heeft_jouw_lach_gestolen-single-web-nl-2022-cover.jpg').key, tracks)
|
||||
})
|
||||
|
||||
test('a host and a sponsor without a counter name no upload', ({ assert }) => {
|
||||
|
||||
Reference in new issue
Block a user