mirror of
https://github.com/nomadkaraoke/karaoke-gen.git
synced 2026-12-04 17:16:04 +09:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a213ec4d5d | ||
|
|
b5e3f39d83 | ||
|
|
2ff5e4b49f | ||
|
|
3b5fd07ba0 |
No files matched your search
@@ -11,7 +11,7 @@ Submission (POST /bulk/submit) and progress (GET /bulk/{batch_id}) live here too
|
||||
|
||||
import logging
|
||||
import uuid
|
||||
from typing import Optional
|
||||
from typing import Literal, Optional
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, Query, Request
|
||||
from pydantic import BaseModel, Field
|
||||
@@ -55,6 +55,24 @@ class BulkEdition(BaseModel):
|
||||
track_count: int = 0
|
||||
|
||||
|
||||
class BulkEditionVariant(BaseModel):
|
||||
"""A distinct tracklist variant (country pressings collapsed by track count)."""
|
||||
|
||||
representative_release_mbid: str
|
||||
label: Literal["Original", "Reissue"] = "Original"
|
||||
track_count: int = 0
|
||||
year: str = ""
|
||||
pressing_count: int = 0
|
||||
delta_vs_original: int = 0
|
||||
|
||||
|
||||
class CommunityVersion(BaseModel):
|
||||
"""An existing community karaoke version the user can preview on YouTube."""
|
||||
|
||||
brand: str
|
||||
url: str
|
||||
|
||||
|
||||
class BulkTrack(BaseModel):
|
||||
position: Optional[int] = None
|
||||
title: str
|
||||
@@ -65,15 +83,18 @@ class BulkTrack(BaseModel):
|
||||
# Availability (filled from KaraokeNerds); available=True => already exists
|
||||
available: bool = False
|
||||
brands: list[str] = []
|
||||
versions: list[CommunityVersion] = []
|
||||
|
||||
|
||||
class BulkTracklistResponse(BaseModel):
|
||||
release_mbid: Optional[str] = None
|
||||
canonical_release_mbid: Optional[str] = None
|
||||
selected_variant_mbid: Optional[str] = None
|
||||
title: Optional[str] = None
|
||||
date: str = ""
|
||||
tracks: list[BulkTrack] = []
|
||||
editions: list[BulkEdition] = []
|
||||
variants: list[BulkEditionVariant] = []
|
||||
|
||||
|
||||
class AvailabilityItem(BaseModel):
|
||||
@@ -91,6 +112,7 @@ class AvailabilityResult(BaseModel):
|
||||
available: bool
|
||||
brands: list[str] = []
|
||||
brand_count: int = 0
|
||||
versions: list[CommunityVersion] = []
|
||||
|
||||
|
||||
class AvailabilityResponse(BaseModel):
|
||||
@@ -140,11 +162,21 @@ async def album_tracklist(
|
||||
artist: str = Query(..., min_length=1, description="Artist name for availability checks"),
|
||||
release_group_mbid: Optional[str] = Query(None),
|
||||
release_mbid: Optional[str] = Query(None, description="Specific edition to load"),
|
||||
locale: Optional[str] = Query(None, description="UI locale → biases representative-pressing choice"),
|
||||
auth_result: AuthResult = Depends(require_auth),
|
||||
):
|
||||
"""Resolve an album's canonical tracklist (or a specific edition) and enrich
|
||||
each track with KaraokeNerds community-version availability."""
|
||||
from backend.services.musicbrainz_service import get_musicbrainz_service
|
||||
each track with KaraokeNerds community-version availability.
|
||||
|
||||
Response shape note: ``variants`` is only populated on the ``release_group_mbid``
|
||||
path (the initial album load). When loading a specific edition via
|
||||
``release_mbid`` it is intentionally ``[]`` — the client already holds the
|
||||
variant list from the initial load and only needs the chosen edition's tracks.
|
||||
"""
|
||||
from backend.services.musicbrainz_service import (
|
||||
get_musicbrainz_service,
|
||||
country_prefs_for_locale,
|
||||
)
|
||||
from backend.services.karaokenerds_service import check_community_versions_batch
|
||||
|
||||
if not release_group_mbid and not release_mbid:
|
||||
@@ -153,11 +185,16 @@ async def album_tracklist(
|
||||
mb = get_musicbrainz_service()
|
||||
try:
|
||||
if release_mbid:
|
||||
# Loading a specific variant — variants already known to the client.
|
||||
tracklist = await mb.get_release_tracklist(release_mbid)
|
||||
tracklist.setdefault("editions", [])
|
||||
tracklist.setdefault("canonical_release_mbid", release_mbid)
|
||||
tracklist.setdefault("variants", [])
|
||||
tracklist.setdefault("selected_variant_mbid", release_mbid)
|
||||
else:
|
||||
tracklist = await mb.get_album_tracklist(release_group_mbid)
|
||||
tracklist = await mb.get_album_tracklist(
|
||||
release_group_mbid, preferred_countries=country_prefs_for_locale(locale)
|
||||
)
|
||||
except Exception as e: # noqa: BLE001
|
||||
logger.warning("MusicBrainz tracklist failed: %r", e, exc_info=True)
|
||||
raise HTTPException(status_code=502, detail="Tracklist lookup is temporarily unavailable")
|
||||
@@ -171,16 +208,19 @@ async def album_tracklist(
|
||||
for t, a in zip(tracks, avail):
|
||||
t["available"] = a["available"]
|
||||
t["brands"] = a["brands"]
|
||||
t["versions"] = a.get("versions", [])
|
||||
except Exception as e: # noqa: BLE001
|
||||
logger.warning("Availability enrichment failed (non-fatal): %s", e)
|
||||
|
||||
return BulkTracklistResponse(
|
||||
release_mbid=tracklist.get("release_mbid"),
|
||||
canonical_release_mbid=tracklist.get("canonical_release_mbid"),
|
||||
selected_variant_mbid=tracklist.get("selected_variant_mbid"),
|
||||
title=tracklist.get("title"),
|
||||
date=tracklist.get("date", ""),
|
||||
tracks=[BulkTrack(**t) for t in tracks],
|
||||
editions=[BulkEdition(**e) for e in tracklist.get("editions", [])],
|
||||
variants=[BulkEditionVariant(**v) for v in tracklist.get("variants", [])],
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1581,11 +1581,72 @@ def _validate_url(url: Optional[str]) -> bool:
|
||||
for supported in supported_domains:
|
||||
if domain == supported or domain.endswith('.' + supported):
|
||||
return True
|
||||
|
||||
|
||||
# For other URLs, let yt-dlp try (it supports many more sites)
|
||||
return True
|
||||
|
||||
|
||||
# Streaming services whose catalogue is DRM-protected and therefore cannot be
|
||||
# downloaded by yt-dlp / flacfetch. Submitting one of these only creates a job
|
||||
# that fails deep in the download stage with a cryptic "Unsupported URL" error
|
||||
# (and lets the user trigger a futile retry), so we reject them at submission
|
||||
# time with a clear, actionable message. Maps host -> friendly platform name;
|
||||
# matching is suffix-based, so e.g. "spotify.com" also covers open./play.
|
||||
_UNSUPPORTED_DRM_HOSTS = {
|
||||
'music.apple.com': 'Apple Music',
|
||||
'itunes.apple.com': 'Apple Music',
|
||||
'spotify.com': 'Spotify',
|
||||
'tidal.com': 'Tidal',
|
||||
'deezer.com': 'Deezer',
|
||||
'pandora.com': 'Pandora',
|
||||
}
|
||||
|
||||
# Third-party tools that can download audio from a DRM platform, which the user
|
||||
# can then upload to us. Only listed where we've verified one works; platforms
|
||||
# without an entry get a generic "download elsewhere, then upload" suggestion.
|
||||
_DRM_DOWNLOADER_SUGGESTIONS = {
|
||||
'Apple Music': 'https://am-dl.pages.dev',
|
||||
}
|
||||
|
||||
|
||||
def _unsupported_url_platform(url: Optional[str]) -> Optional[str]:
|
||||
"""
|
||||
Return a friendly platform name if the URL belongs to a known DRM-protected
|
||||
streaming service that cannot be downloaded, else None.
|
||||
|
||||
These links (Apple Music, Spotify, Tidal, Amazon Music, Deezer, Pandora) are
|
||||
rejected at submission time instead of being allowed to create a job that
|
||||
always fails deep in the download stage. Note: YouTube Music
|
||||
(music.youtube.com) is downloadable and is deliberately NOT included.
|
||||
"""
|
||||
if not url or not isinstance(url, str):
|
||||
return None
|
||||
|
||||
from urllib.parse import urlparse
|
||||
try:
|
||||
domain = urlparse(url).netloc.lower()
|
||||
except (ValueError, TypeError):
|
||||
return None
|
||||
|
||||
# Remove port if present
|
||||
if ':' in domain:
|
||||
domain = domain.split(':')[0]
|
||||
# Normalise leading www.
|
||||
if domain.startswith('www.'):
|
||||
domain = domain[4:]
|
||||
|
||||
for host, platform in _UNSUPPORTED_DRM_HOSTS.items():
|
||||
if domain == host or domain.endswith('.' + host):
|
||||
return platform
|
||||
|
||||
# Amazon Music spans many country domains (music.amazon.com, .co.uk, .co.jp,
|
||||
# .fr, .de, ...), so match the music.amazon.* prefix generically.
|
||||
if domain == 'music.amazon' or domain.startswith('music.amazon.'):
|
||||
return 'Amazon Music'
|
||||
|
||||
return None
|
||||
|
||||
|
||||
@router.post("/jobs/create-from-url", response_model=CreateJobFromUrlResponse)
|
||||
async def create_job_from_url(
|
||||
request: Request,
|
||||
@@ -1619,6 +1680,25 @@ async def create_job_from_url(
|
||||
)
|
||||
|
||||
try:
|
||||
# Reject DRM-protected streaming links upfront (Apple Music, Spotify,
|
||||
# Tidal, etc.). These can never be downloaded, so creating a job would
|
||||
# only fail deep in the pipeline with a cryptic error and tempt the user
|
||||
# into a futile retry storm.
|
||||
unsupported_platform = _unsupported_url_platform(body.url)
|
||||
if unsupported_platform:
|
||||
downloader = _DRM_DOWNLOADER_SUGGESTIONS.get(unsupported_platform)
|
||||
if downloader:
|
||||
detail = t(
|
||||
locale, "audioSearch.drmUrlUnsupportedWithLink",
|
||||
platform=unsupported_platform, downloader=downloader,
|
||||
)
|
||||
else:
|
||||
detail = t(
|
||||
locale, "audioSearch.drmUrlUnsupported",
|
||||
platform=unsupported_platform,
|
||||
)
|
||||
raise HTTPException(status_code=400, detail=detail)
|
||||
|
||||
# Validate URL
|
||||
if not _validate_url(body.url):
|
||||
raise HTTPException(
|
||||
|
||||
@@ -1982,9 +1982,18 @@ async def retry_job(
|
||||
"retry_stage": "screens_generation"
|
||||
}
|
||||
|
||||
# If we have input audio (uploaded or from URL), restart from beginning
|
||||
elif job.input_media_gcs_path or job.url:
|
||||
logger.info(f"Job {job_id}: Has input audio, restarting from beginning")
|
||||
# If the input audio is already in GCS (an uploaded file, or a URL whose
|
||||
# download succeeded), restart from beginning — the audio/lyrics workers
|
||||
# re-fetch it from GCS.
|
||||
#
|
||||
# A URL job whose download never succeeded has only `job.url` and NO
|
||||
# audio in GCS, so it must NOT take this branch: triggering the workers
|
||||
# would just fail with "Failed to download audio file" and Cloud Run
|
||||
# would retry them repeatedly (see job 7f36304a — an Apple Music link).
|
||||
# Such jobs fall through to the "resubmit" refusal below, since there is
|
||||
# no worker that re-downloads a generic URL.
|
||||
elif job.input_media_gcs_path:
|
||||
logger.info(f"Job {job_id}: Has input audio in GCS, restarting from beginning")
|
||||
|
||||
# Clear error state and any partial progress
|
||||
job_manager.update_job(job_id, {
|
||||
|
||||
@@ -15,12 +15,22 @@ from urllib.parse import urlencode
|
||||
import httpx
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
from backend.services.match_judge.classifier import normalize_for_match
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
SEARCH_URL = "https://karaokenerds.com/Search"
|
||||
REQUEST_TIMEOUT = 8
|
||||
USER_AGENT = "NomadKaraokeGen/1.0"
|
||||
|
||||
# karaokenerds.com's search silently returns zero results once a query exceeds
|
||||
# ~10 whitespace-separated terms (observed: 10 terms match, 11 return nothing).
|
||||
# Long/repetitive titles like "I Do, I Do, I Do, I Do, I Do" combined with the
|
||||
# artist blow past this, so the song is falsely reported as having no community
|
||||
# version. When that happens we retry with the title alone (the highest-signal
|
||||
# term) and keep only results whose artist matches.
|
||||
MAX_RELIABLE_QUERY_TERMS = 10
|
||||
|
||||
# In-memory TTL cache: { cache_key: (expiry_timestamp, data) }
|
||||
_cache: dict[str, tuple[float, Any]] = {}
|
||||
CACHE_TTL_SECONDS = 3600 # 1 hour
|
||||
@@ -146,6 +156,45 @@ def parse_results(html: str) -> list[dict]:
|
||||
return songs
|
||||
|
||||
|
||||
async def _search_songs(query: str) -> list[dict] | None:
|
||||
"""Run a single karaokenerds search and parse the results.
|
||||
|
||||
Returns the parsed song list, or ``None`` if the HTTP request failed (so the
|
||||
caller can distinguish "search errored" from "search returned nothing").
|
||||
"""
|
||||
params = urlencode({"query": query, "webFilter": "OnlyWeb"})
|
||||
url = f"{SEARCH_URL}?{params}"
|
||||
try:
|
||||
async with httpx.AsyncClient(timeout=REQUEST_TIMEOUT) as client:
|
||||
resp = await client.get(
|
||||
url,
|
||||
headers={"User-Agent": USER_AGENT},
|
||||
follow_redirects=True,
|
||||
)
|
||||
resp.raise_for_status()
|
||||
except Exception as e:
|
||||
logger.warning(f"KaraokeNerds search failed for '{query}': {e}")
|
||||
return None
|
||||
return parse_results(resp.text)
|
||||
|
||||
|
||||
def _extract_community_songs(songs: list[dict]) -> tuple[list[dict], str | None]:
|
||||
"""Filter parsed songs to those with community tracks; return (songs, best_url)."""
|
||||
community_songs: list[dict] = []
|
||||
best_youtube_url: str | None = None
|
||||
for song in songs:
|
||||
community_tracks = [t for t in song["tracks"] if t["is_community"]]
|
||||
if community_tracks:
|
||||
community_songs.append({
|
||||
"title": song["title"],
|
||||
"artist": song["artist"],
|
||||
"community_tracks": community_tracks,
|
||||
})
|
||||
if best_youtube_url is None:
|
||||
best_youtube_url = community_tracks[0]["youtube_url"]
|
||||
return community_songs, best_youtube_url
|
||||
|
||||
|
||||
async def check_community_versions(artist: str, title: str) -> dict:
|
||||
"""
|
||||
Check if a song has community-approved karaoke versions on karaokenerds.
|
||||
@@ -161,39 +210,32 @@ async def check_community_versions(artist: str, title: str) -> dict:
|
||||
if cached is not None:
|
||||
return cached
|
||||
|
||||
params = urlencode({"query": query, "webFilter": "OnlyWeb"})
|
||||
url = f"{SEARCH_URL}?{params}"
|
||||
|
||||
try:
|
||||
async with httpx.AsyncClient(timeout=REQUEST_TIMEOUT) as client:
|
||||
resp = await client.get(
|
||||
url,
|
||||
headers={"User-Agent": USER_AGENT},
|
||||
follow_redirects=True,
|
||||
)
|
||||
resp.raise_for_status()
|
||||
except Exception as e:
|
||||
logger.warning(f"KaraokeNerds search failed for '{query}': {e}")
|
||||
songs = await _search_songs(query)
|
||||
if songs is None:
|
||||
# Hard failure (network/HTTP) — cache a negative so we don't hammer the
|
||||
# site, matching prior behaviour.
|
||||
result = {"has_community": False, "songs": [], "best_youtube_url": None}
|
||||
_cache_set(cache_key, result)
|
||||
return result
|
||||
|
||||
songs = parse_results(resp.text)
|
||||
# karaokenerds chokes on overlong queries and returns nothing. If the
|
||||
# combined "artist title" query was too long AND came back empty, retry with
|
||||
# the title alone, then keep only results whose artist matches (title-only is
|
||||
# broader, so this guards against same-titled songs by other artists).
|
||||
if (
|
||||
not songs
|
||||
and title.strip()
|
||||
and len(query.split()) > MAX_RELIABLE_QUERY_TERMS
|
||||
):
|
||||
fallback = await _search_songs(title)
|
||||
if fallback:
|
||||
key_artist = normalize_for_match(artist)
|
||||
songs = [
|
||||
s for s in fallback
|
||||
if normalize_for_match(s.get("artist") or "") == key_artist
|
||||
]
|
||||
|
||||
# Filter to only songs that have community tracks with YouTube URLs
|
||||
community_songs = []
|
||||
best_youtube_url = None
|
||||
|
||||
for song in songs:
|
||||
community_tracks = [t for t in song["tracks"] if t["is_community"]]
|
||||
if community_tracks:
|
||||
community_songs.append({
|
||||
"title": song["title"],
|
||||
"artist": song["artist"],
|
||||
"community_tracks": community_tracks,
|
||||
})
|
||||
if best_youtube_url is None:
|
||||
best_youtube_url = community_tracks[0]["youtube_url"]
|
||||
community_songs, best_youtube_url = _extract_community_songs(songs)
|
||||
|
||||
result = {
|
||||
"has_community": len(community_songs) > 0,
|
||||
@@ -211,8 +253,11 @@ async def check_community_versions_batch(
|
||||
|
||||
``songs`` is a list of ``{"artist": str, "title": str}``. Returns a list in the
|
||||
same order, each ``{"artist", "title", "available": bool, "brands": [str],
|
||||
"brand_count": int}``. Bounded concurrency keeps us polite to karaokenerds.com;
|
||||
per-song results reuse the existing 1h cache. A failed lookup degrades to
|
||||
"brand_count": int, "versions": [{"brand": str, "url": str}]}``. ``versions`` is
|
||||
the per-community-version detail (deduped by brand, first YouTube URL kept) the UI
|
||||
uses to render clickable links; ``brands``/``brand_count`` are retained for
|
||||
back-compat. Bounded concurrency keeps us polite to karaokenerds.com; per-song
|
||||
results reuse the existing 1h cache. A failed lookup degrades to
|
||||
``available=False`` (the track simply stays selectable) — never raises.
|
||||
"""
|
||||
sem = asyncio.Semaphore(max(1, concurrency))
|
||||
@@ -221,21 +266,32 @@ async def check_community_versions_batch(
|
||||
artist = (song.get("artist") or "").strip()
|
||||
title = (song.get("title") or "").strip()
|
||||
if not artist or not title:
|
||||
return {"artist": artist, "title": title, "available": False, "brands": [], "brand_count": 0}
|
||||
return {"artist": artist, "title": title, "available": False,
|
||||
"brands": [], "brand_count": 0, "versions": []}
|
||||
async with sem:
|
||||
res = await check_community_versions(artist, title)
|
||||
versions: list[dict] = []
|
||||
versioned_brands: set[str] = set()
|
||||
brands: list[str] = []
|
||||
for matched in res.get("songs", []):
|
||||
for track in matched.get("community_tracks", []):
|
||||
name = track.get("brand_name")
|
||||
if name and name not in brands:
|
||||
if not name:
|
||||
continue
|
||||
if name not in brands:
|
||||
brands.append(name)
|
||||
# A clickable version needs a URL; brand still counts as "exists" without one.
|
||||
url = track.get("youtube_url")
|
||||
if url and name not in versioned_brands:
|
||||
versioned_brands.add(name)
|
||||
versions.append({"brand": name, "url": url})
|
||||
return {
|
||||
"artist": artist,
|
||||
"title": title,
|
||||
"available": bool(res.get("has_community")),
|
||||
"brands": brands,
|
||||
"brand_count": len(brands),
|
||||
"versions": versions,
|
||||
}
|
||||
|
||||
return await asyncio.gather(*[_one(s) for s in songs])
|
||||
@@ -44,6 +44,36 @@ _RETRY_BACKOFF_S = 0.5
|
||||
# Country preference for canonical-release tie-breaks (worldwide / Europe / US / UK).
|
||||
_PREFERRED_COUNTRIES = ["XW", "XE", "US", "GB"]
|
||||
|
||||
# Locale → ordered country preference for picking which pressing backs a variant.
|
||||
# Biases the representative release toward the user's likely region; falls back to
|
||||
# the worldwide default for anything unmapped. Keyed by the language part of the
|
||||
# locale (region suffix is ignored, e.g. "en-US" → "en").
|
||||
_LOCALE_COUNTRY_PREFS: Dict[str, List[str]] = {
|
||||
"en": ["GB", "US", "AU", "CA", "IE", "NZ"],
|
||||
"es": ["ES", "MX", "AR"],
|
||||
"fr": ["FR", "CA", "BE"],
|
||||
"de": ["DE", "AT", "CH"],
|
||||
"it": ["IT"],
|
||||
"pt": ["PT", "BR"],
|
||||
"nl": ["NL", "BE"],
|
||||
"sv": ["SE"],
|
||||
"ja": ["JP"],
|
||||
"ko": ["KR"],
|
||||
"zh": ["CN", "TW", "HK"],
|
||||
}
|
||||
|
||||
|
||||
def country_prefs_for_locale(locale: Optional[str]) -> List[str]:
|
||||
"""Map a next-intl locale to an ordered country preference list.
|
||||
|
||||
Returns a copy of the worldwide default (``_PREFERRED_COUNTRIES``) for an
|
||||
empty/unknown locale so callers can mutate freely.
|
||||
"""
|
||||
if not locale:
|
||||
return list(_PREFERRED_COUNTRIES)
|
||||
base = re.split(r"[-_]", locale)[0].lower()
|
||||
return list(_LOCALE_COUNTRY_PREFS.get(base, _PREFERRED_COUNTRIES))
|
||||
|
||||
# "Extra" track qualifier keywords. Matched only inside (), [], or after " - "
|
||||
# so we don't misfire on legitimate titles that happen to contain a word.
|
||||
_EXTRA_KEYWORDS = [
|
||||
@@ -210,14 +240,19 @@ class MusicBrainzService:
|
||||
return editions
|
||||
|
||||
@staticmethod
|
||||
def pick_canonical_edition(editions: List[Dict[str, Any]]) -> Optional[Dict[str, Any]]:
|
||||
def pick_canonical_edition(
|
||||
editions: List[Dict[str, Any]],
|
||||
preferred_countries: Optional[List[str]] = None,
|
||||
) -> Optional[Dict[str, Any]]:
|
||||
"""Pick the standard edition: official, modal track count, earliest, preferred country.
|
||||
|
||||
Choosing the most common track count avoids deluxe/remaster editions that
|
||||
tack bonus tracks on the end.
|
||||
tack bonus tracks on the end. ``preferred_countries`` overrides the default
|
||||
worldwide-first tie-break (used for locale-aware selection).
|
||||
"""
|
||||
if not editions:
|
||||
return None
|
||||
prefs = preferred_countries or _PREFERRED_COUNTRIES
|
||||
official = [e for e in editions if e.get("status") == "Official"] or editions
|
||||
with_tracks = [e for e in official if e.get("track_count", 0) > 0] or official
|
||||
counts = Counter(e["track_count"] for e in with_tracks if e.get("track_count", 0) > 0)
|
||||
@@ -229,11 +264,65 @@ class MusicBrainzService:
|
||||
|
||||
def country_rank(e: Dict[str, Any]) -> int:
|
||||
c = e.get("country")
|
||||
return _PREFERRED_COUNTRIES.index(c) if c in _PREFERRED_COUNTRIES else len(_PREFERRED_COUNTRIES)
|
||||
return prefs.index(c) if c in prefs else len(prefs)
|
||||
|
||||
candidates.sort(key=lambda e: (e.get("date") or "9999", country_rank(e)))
|
||||
return candidates[0]
|
||||
|
||||
@staticmethod
|
||||
def build_variants(
|
||||
editions: List[Dict[str, Any]],
|
||||
preferred_countries: Optional[List[str]] = None,
|
||||
) -> List[Dict[str, Any]]:
|
||||
"""Collapse a release-group's editions into distinct tracklist *variants*.
|
||||
|
||||
Country pressings are irrelevant for karaoke (we only need the track names),
|
||||
so editions are grouped by ``track_count`` — within one release-group, same
|
||||
count ≈ same songs. Each variant exposes a representative release (earliest +
|
||||
preferred-country), the earliest year, how many pressings collapsed in, and a
|
||||
label/delta relative to the "Original" (earliest) variant. Editions without a
|
||||
track count are dropped. See
|
||||
``docs/archive/2026-06-22-bulk-edition-collapse-and-community-versions-design.md``.
|
||||
"""
|
||||
if not editions:
|
||||
return []
|
||||
official = [e for e in editions if e.get("status") == "Official"] or editions
|
||||
with_tracks = [e for e in official if (e.get("track_count") or 0) > 0]
|
||||
if not with_tracks:
|
||||
return []
|
||||
|
||||
groups: Dict[int, List[Dict[str, Any]]] = {}
|
||||
for e in with_tracks:
|
||||
groups.setdefault(e["track_count"], []).append(e)
|
||||
|
||||
variants: List[Dict[str, Any]] = []
|
||||
for track_count, group in groups.items():
|
||||
rep = MusicBrainzService.pick_canonical_edition(group, preferred_countries)
|
||||
earliest = min((e.get("date") or "9999") for e in group)
|
||||
year = earliest[:4] if earliest and earliest != "9999" else ""
|
||||
variants.append(
|
||||
{
|
||||
"representative_release_mbid": rep["release_mbid"],
|
||||
"track_count": track_count,
|
||||
"year": year,
|
||||
"pressing_count": len(group),
|
||||
"_earliest": earliest,
|
||||
}
|
||||
)
|
||||
|
||||
# Original = earliest release, then most pressings, then fewest tracks.
|
||||
variants.sort(key=lambda v: (v["_earliest"], -v["pressing_count"], v["track_count"]))
|
||||
original = variants[0]
|
||||
original_tc = original["track_count"]
|
||||
for v in variants:
|
||||
v["delta_vs_original"] = v["track_count"] - original_tc
|
||||
v["label"] = "Original" if v is original else "Reissue"
|
||||
del v["_earliest"]
|
||||
|
||||
# Display order: Original first, then by year ascending, then track count.
|
||||
variants.sort(key=lambda v: (v["label"] != "Original", v["year"] or "9999", v["track_count"]))
|
||||
return variants
|
||||
|
||||
async def get_release_tracklist(self, release_mbid: str) -> Dict[str, Any]:
|
||||
"""Fetch a release's tracklist with per-track extra detection."""
|
||||
data = await self._get(f"release/{release_mbid}", {"inc": "recordings"})
|
||||
@@ -264,15 +353,31 @@ class MusicBrainzService:
|
||||
"tracks": tracks,
|
||||
}
|
||||
|
||||
async def get_album_tracklist(self, release_group_mbid: str) -> Dict[str, Any]:
|
||||
"""Resolve the canonical edition of an album and return its tracklist + editions."""
|
||||
async def get_album_tracklist(
|
||||
self,
|
||||
release_group_mbid: str,
|
||||
preferred_countries: Optional[List[str]] = None,
|
||||
) -> Dict[str, Any]:
|
||||
"""Resolve the canonical edition of an album and return its tracklist, the raw
|
||||
editions, and the collapsed tracklist ``variants``. ``preferred_countries``
|
||||
biases representative selection (locale-aware)."""
|
||||
editions = await self._list_editions(release_group_mbid)
|
||||
canonical = self.pick_canonical_edition(editions)
|
||||
canonical = self.pick_canonical_edition(editions, preferred_countries)
|
||||
variants = self.build_variants(editions, preferred_countries)
|
||||
if not canonical:
|
||||
return {"release_mbid": None, "title": None, "tracks": [], "editions": editions}
|
||||
return {
|
||||
"release_mbid": None,
|
||||
"title": None,
|
||||
"tracks": [],
|
||||
"editions": editions,
|
||||
"variants": variants,
|
||||
"selected_variant_mbid": None,
|
||||
}
|
||||
tracklist = await self.get_release_tracklist(canonical["release_mbid"])
|
||||
tracklist["editions"] = editions
|
||||
tracklist["canonical_release_mbid"] = canonical["release_mbid"]
|
||||
tracklist["variants"] = variants
|
||||
tracklist["selected_variant_mbid"] = canonical["release_mbid"]
|
||||
return tracklist
|
||||
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ class TestAlbumTracklistRoute:
|
||||
from backend.services import karaokenerds_service as kn
|
||||
|
||||
class FakeMB:
|
||||
async def get_album_tracklist(self, rg):
|
||||
async def get_album_tracklist(self, rg, preferred_countries=None):
|
||||
return {
|
||||
"release_mbid": "rel1",
|
||||
"canonical_release_mbid": "rel1",
|
||||
@@ -112,3 +112,62 @@ class TestAlbumTracklistRoute:
|
||||
def test_tracklist_requires_an_id(self, client):
|
||||
resp = client.get("/api/bulk/album/tracklist", params={"artist": "X"})
|
||||
assert resp.status_code == 422
|
||||
|
||||
|
||||
class TestVariantsAndVersions:
|
||||
def test_tracklist_returns_variants_versions_and_passes_locale(self, client, monkeypatch):
|
||||
from backend.services import musicbrainz_service as mbs
|
||||
from backend.services import karaokenerds_service as kn
|
||||
|
||||
captured = {}
|
||||
|
||||
class FakeMB:
|
||||
async def get_album_tracklist(self, rg, preferred_countries=None):
|
||||
captured["prefs"] = preferred_countries
|
||||
return {
|
||||
"release_mbid": "rel1", "canonical_release_mbid": "rel1",
|
||||
"selected_variant_mbid": "rel1", "title": "Arrival", "date": "1976",
|
||||
"tracks": [{"position": 1, "title": "Dancing Queen", "recording_mbid": "r1",
|
||||
"length_ms": 230000, "is_extra": False, "extra_reason": ""}],
|
||||
"editions": [],
|
||||
"variants": [
|
||||
{"representative_release_mbid": "rel1", "label": "Original",
|
||||
"track_count": 10, "year": "1976", "pressing_count": 6, "delta_vs_original": 0},
|
||||
{"representative_release_mbid": "rel2", "label": "Reissue",
|
||||
"track_count": 12, "year": "2014", "pressing_count": 1, "delta_vs_original": 2},
|
||||
],
|
||||
}
|
||||
|
||||
async def fake_batch(songs, concurrency=5):
|
||||
return [{"artist": s["artist"], "title": s["title"], "available": True,
|
||||
"brands": ["SNDL Karaoke"], "brand_count": 1,
|
||||
"versions": [{"brand": "SNDL Karaoke", "url": "https://youtu.be/x"}]}
|
||||
for s in songs]
|
||||
|
||||
monkeypatch.setattr(mbs, "get_musicbrainz_service", lambda: FakeMB())
|
||||
monkeypatch.setattr(kn, "check_community_versions_batch", fake_batch)
|
||||
|
||||
resp = client.get("/api/bulk/album/tracklist",
|
||||
params={"artist": "ABBA", "release_group_mbid": "rg", "locale": "ja"})
|
||||
assert resp.status_code == 200
|
||||
data = resp.json()
|
||||
assert len(data["variants"]) == 2
|
||||
assert data["variants"][0]["label"] == "Original"
|
||||
assert data["variants"][1]["delta_vs_original"] == 2
|
||||
assert data["selected_variant_mbid"] == "rel1"
|
||||
assert data["tracks"][0]["versions"] == [{"brand": "SNDL Karaoke", "url": "https://youtu.be/x"}]
|
||||
# Japanese locale → JP country preference threaded to MB service.
|
||||
assert captured["prefs"] == ["JP"]
|
||||
|
||||
def test_availability_returns_versions(self, client, monkeypatch):
|
||||
from backend.services import karaokenerds_service as kn
|
||||
|
||||
async def fake_batch(songs, concurrency=5):
|
||||
return [{"artist": s["artist"], "title": s["title"], "available": True,
|
||||
"brands": ["KV"], "brand_count": 1,
|
||||
"versions": [{"brand": "KV", "url": "https://youtu.be/kv"}]} for s in songs]
|
||||
|
||||
monkeypatch.setattr(kn, "check_community_versions_batch", fake_batch)
|
||||
resp = client.post("/api/bulk/availability", json={"tracks": [{"artist": "A", "title": "B"}]})
|
||||
assert resp.status_code == 200
|
||||
assert resp.json()["results"][0]["versions"] == [{"brand": "KV", "url": "https://youtu.be/kv"}]
|
||||
@@ -1249,7 +1249,7 @@ class TestURLValidation:
|
||||
def test_other_supported_platforms(self):
|
||||
"""Test other supported video platforms."""
|
||||
from backend.api.routes.file_upload import _validate_url
|
||||
|
||||
|
||||
valid_urls = [
|
||||
"https://twitter.com/user/status/123",
|
||||
"https://x.com/user/status/123",
|
||||
@@ -1257,11 +1257,86 @@ class TestURLValidation:
|
||||
"https://www.instagram.com/reel/abc123/",
|
||||
"https://www.tiktok.com/@user/video/123",
|
||||
]
|
||||
|
||||
|
||||
for url in valid_urls:
|
||||
assert _validate_url(url), f"URL should be valid: {url}"
|
||||
|
||||
|
||||
class TestUnsupportedDrmUrl:
|
||||
"""Test detection of DRM-protected streaming URLs that can't be downloaded."""
|
||||
|
||||
def test_apple_music_urls_detected(self):
|
||||
from backend.api.routes.file_upload import _unsupported_url_platform
|
||||
|
||||
urls = [
|
||||
# The exact URL from the prod incident (job 7f36304a)
|
||||
"https://music.apple.com/us/album/gone-country-apple-music-sessions/1752594347?i=1752594711",
|
||||
"https://music.apple.com/gb/album/whatever/123",
|
||||
"https://itunes.apple.com/us/album/whatever/123",
|
||||
]
|
||||
for url in urls:
|
||||
assert _unsupported_url_platform(url) == "Apple Music", url
|
||||
|
||||
def test_spotify_urls_detected(self):
|
||||
from backend.api.routes.file_upload import _unsupported_url_platform
|
||||
|
||||
urls = [
|
||||
"https://open.spotify.com/track/abc123",
|
||||
"https://play.spotify.com/track/abc123",
|
||||
"https://spotify.com/track/abc123",
|
||||
]
|
||||
for url in urls:
|
||||
assert _unsupported_url_platform(url) == "Spotify", url
|
||||
|
||||
def test_other_drm_platforms_detected(self):
|
||||
from backend.api.routes.file_upload import _unsupported_url_platform
|
||||
|
||||
cases = {
|
||||
"https://tidal.com/browse/track/123": "Tidal",
|
||||
"https://listen.tidal.com/track/123": "Tidal",
|
||||
"https://music.amazon.com/albums/B0ABC": "Amazon Music",
|
||||
"https://music.amazon.co.uk/albums/B0ABC": "Amazon Music",
|
||||
"https://music.amazon.co.jp/albums/B0ABC": "Amazon Music",
|
||||
"https://music.amazon.fr/albums/B0ABC": "Amazon Music",
|
||||
"https://www.deezer.com/track/123": "Deezer",
|
||||
"https://www.pandora.com/artist/song": "Pandora",
|
||||
}
|
||||
for url, platform in cases.items():
|
||||
assert _unsupported_url_platform(url) == platform, url
|
||||
|
||||
def test_supported_urls_not_flagged(self):
|
||||
from backend.api.routes.file_upload import _unsupported_url_platform
|
||||
|
||||
# YouTube Music IS downloadable and must NOT be flagged.
|
||||
ok_urls = [
|
||||
"https://www.youtube.com/watch?v=dQw4w9WgXcQ",
|
||||
"https://youtu.be/dQw4w9WgXcQ",
|
||||
"https://music.youtube.com/watch?v=dQw4w9WgXcQ",
|
||||
"https://vimeo.com/123",
|
||||
"https://soundcloud.com/artist/track",
|
||||
"https://example.com/some/audio.mp3",
|
||||
"",
|
||||
None,
|
||||
]
|
||||
for url in ok_urls:
|
||||
assert _unsupported_url_platform(url) is None, url
|
||||
|
||||
def test_downloader_suggestions_are_valid(self):
|
||||
"""Every downloader suggestion must map a real platform to an https URL."""
|
||||
from backend.api.routes.file_upload import (
|
||||
_DRM_DOWNLOADER_SUGGESTIONS,
|
||||
_UNSUPPORTED_DRM_HOSTS,
|
||||
)
|
||||
|
||||
known_platforms = set(_UNSUPPORTED_DRM_HOSTS.values()) | {"Amazon Music"}
|
||||
for platform, url in _DRM_DOWNLOADER_SUGGESTIONS.items():
|
||||
assert platform in known_platforms, f"{platform} is not a known DRM platform"
|
||||
assert url.startswith("https://"), f"{platform} downloader must be https"
|
||||
|
||||
# Apple Music is the verified case driving this feature.
|
||||
assert _DRM_DOWNLOADER_SUGGESTIONS.get("Apple Music") == "https://am-dl.pages.dev"
|
||||
|
||||
|
||||
class TestCreateJobFromUrlRequest:
|
||||
"""Test CreateJobFromUrlRequest Pydantic model."""
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ from backend.services.karaokenerds_service import (
|
||||
parse_results,
|
||||
_clean_youtube_url,
|
||||
_parse_single_track,
|
||||
check_community_versions,
|
||||
check_community_versions_batch,
|
||||
)
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
@@ -207,3 +209,168 @@ def test_parse_results_empty_html():
|
||||
|
||||
def test_parse_results_no_table():
|
||||
assert parse_results("<div>No results</div>") == []
|
||||
|
||||
|
||||
# --- Batch availability: per-version data with YouTube URLs (Bulk Mode) ---
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_batch_returns_versions_with_urls_deduped_by_brand(monkeypatch):
|
||||
"""Each result carries `versions: [{brand, url}]` (community only), deduped by
|
||||
brand keeping the first URL, alongside the existing brands/brand_count."""
|
||||
|
||||
async def fake_check(artist, title):
|
||||
return {
|
||||
"has_community": True,
|
||||
"songs": [
|
||||
{
|
||||
"title": title,
|
||||
"artist": artist,
|
||||
"community_tracks": [
|
||||
{"brand_name": "SNDL Karaoke", "brand_code": "SNDL",
|
||||
"youtube_url": "https://www.youtube.com/watch?v=aaa", "is_community": True},
|
||||
{"brand_name": "Nomad Karaoke", "brand_code": "NK",
|
||||
"youtube_url": "https://www.youtube.com/watch?v=bbb", "is_community": True},
|
||||
# Duplicate brand — should be collapsed, keeping the first URL.
|
||||
{"brand_name": "SNDL Karaoke", "brand_code": "SNDL",
|
||||
"youtube_url": "https://www.youtube.com/watch?v=ccc", "is_community": True},
|
||||
],
|
||||
}
|
||||
],
|
||||
"best_youtube_url": "https://www.youtube.com/watch?v=aaa",
|
||||
}
|
||||
|
||||
monkeypatch.setattr(
|
||||
"backend.services.karaokenerds_service.check_community_versions", fake_check
|
||||
)
|
||||
|
||||
results = await check_community_versions_batch(
|
||||
[{"artist": "ABBA", "title": "Dancing Queen"}]
|
||||
)
|
||||
|
||||
assert len(results) == 1
|
||||
r = results[0]
|
||||
assert r["available"] is True
|
||||
assert r["versions"] == [
|
||||
{"brand": "SNDL Karaoke", "url": "https://www.youtube.com/watch?v=aaa"},
|
||||
{"brand": "Nomad Karaoke", "url": "https://www.youtube.com/watch?v=bbb"},
|
||||
]
|
||||
# Back-compat retained.
|
||||
assert r["brands"] == ["SNDL Karaoke", "Nomad Karaoke"]
|
||||
assert r["brand_count"] == 2
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_batch_empty_song_has_empty_versions():
|
||||
results = await check_community_versions_batch([{"artist": "", "title": ""}])
|
||||
assert results[0]["available"] is False
|
||||
assert results[0]["versions"] == []
|
||||
|
||||
|
||||
# --- check_community_versions: overlong-query fallback (KaraokeNerds term cap) ---
|
||||
|
||||
|
||||
def _community_song(title, artist, brand="Nomad Karaoke", url="https://youtu.be/x"):
|
||||
return {
|
||||
"title": title,
|
||||
"artist": artist,
|
||||
"tracks": [
|
||||
{"brand_name": brand, "brand_code": "NK", "youtube_url": url, "is_community": True}
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _clear_community_cache():
|
||||
"""check_community_versions caches in-process; isolate each test."""
|
||||
from backend.services import karaokenerds_service as svc
|
||||
svc._cache.clear()
|
||||
yield
|
||||
svc._cache.clear()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_overlong_query_falls_back_to_title_only(monkeypatch):
|
||||
"""An overlong "artist title" query that returns nothing retries title-only
|
||||
and matches by artist (the ABBA 'I Do, I Do, I Do, I Do, I Do' bug)."""
|
||||
title = "I Do, I Do, I Do, I Do, I Do"
|
||||
calls = []
|
||||
|
||||
async def fake_search(query):
|
||||
calls.append(query)
|
||||
if query == f"ABBA {title}":
|
||||
return [] # combined query is too long -> KaraokeNerds returns nothing
|
||||
if query == title:
|
||||
return [_community_song("I Do I Do I Do I Do I Do", "ABBA")]
|
||||
return []
|
||||
|
||||
monkeypatch.setattr(
|
||||
"backend.services.karaokenerds_service._search_songs", fake_search
|
||||
)
|
||||
|
||||
result = await check_community_versions("ABBA", title)
|
||||
|
||||
assert result["has_community"] is True
|
||||
assert result["songs"][0]["artist"] == "ABBA"
|
||||
assert calls == [f"ABBA {title}", title] # combined first, then title-only fallback
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_fallback_filters_out_wrong_artist(monkeypatch):
|
||||
"""Title-only fallback is broader, so same-titled songs by other artists
|
||||
must be discarded — no false positive."""
|
||||
title = "I Do, I Do, I Do, I Do, I Do"
|
||||
|
||||
async def fake_search(query):
|
||||
if query == title:
|
||||
return [_community_song("I Do I Do I Do I Do I Do", "Some Other Band")]
|
||||
return []
|
||||
|
||||
monkeypatch.setattr(
|
||||
"backend.services.karaokenerds_service._search_songs", fake_search
|
||||
)
|
||||
|
||||
result = await check_community_versions("ABBA", title)
|
||||
|
||||
assert result["has_community"] is False
|
||||
assert result["songs"] == []
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_short_empty_query_does_not_fall_back(monkeypatch):
|
||||
"""A short query that legitimately returns nothing must NOT trigger a second
|
||||
request (avoids doubling load for songs with no community version)."""
|
||||
calls = []
|
||||
|
||||
async def fake_search(query):
|
||||
calls.append(query)
|
||||
return []
|
||||
|
||||
monkeypatch.setattr(
|
||||
"backend.services.karaokenerds_service._search_songs", fake_search
|
||||
)
|
||||
|
||||
result = await check_community_versions("ABBA", "Dancing Queen")
|
||||
|
||||
assert result["has_community"] is False
|
||||
assert calls == ["ABBA Dancing Queen"] # no fallback request
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_nonempty_combined_result_skips_fallback(monkeypatch):
|
||||
"""If the combined query returns results, never fall back even when long."""
|
||||
title = "I Do, I Do, I Do, I Do, I Do"
|
||||
calls = []
|
||||
|
||||
async def fake_search(query):
|
||||
calls.append(query)
|
||||
return [_community_song("I Do I Do I Do I Do I Do", "ABBA")]
|
||||
|
||||
monkeypatch.setattr(
|
||||
"backend.services.karaokenerds_service._search_songs", fake_search
|
||||
)
|
||||
|
||||
result = await check_community_versions("ABBA", title)
|
||||
|
||||
assert result["has_community"] is True
|
||||
assert calls == [f"ABBA {title}"] # only the combined query ran
|
||||
@@ -52,6 +52,88 @@ class TestPickCanonical:
|
||||
assert MusicBrainzService.pick_canonical_edition([]) is None
|
||||
|
||||
|
||||
class TestBuildVariants:
|
||||
"""Collapse a release-group's editions into distinct tracklist variants."""
|
||||
|
||||
def test_same_track_count_editions_collapse_to_one_variant(self):
|
||||
editions = [
|
||||
{"release_mbid": "us76", "status": "Official", "date": "1976", "country": "US", "track_count": 10},
|
||||
{"release_mbid": "se76", "status": "Official", "date": "1976", "country": "SE", "track_count": 10},
|
||||
{"release_mbid": "nl76", "status": "Official", "date": "1976", "country": "NL", "track_count": 10},
|
||||
]
|
||||
variants = MusicBrainzService.build_variants(editions)
|
||||
assert len(variants) == 1
|
||||
v = variants[0]
|
||||
assert v["track_count"] == 10
|
||||
assert v["pressing_count"] == 3
|
||||
assert v["label"] == "Original"
|
||||
assert v["year"] == "1976"
|
||||
assert v["delta_vs_original"] == 0
|
||||
# earliest date (all 1976) then preferred country US over SE/NL
|
||||
assert v["representative_release_mbid"] == "us76"
|
||||
|
||||
def test_distinct_track_counts_form_separate_variants_sorted_original_first(self):
|
||||
editions = [
|
||||
{"release_mbid": "reissue2014", "status": "Official", "date": "2014", "country": "XW", "track_count": 12},
|
||||
{"release_mbid": "orig1976", "status": "Official", "date": "1976", "country": "US", "track_count": 10},
|
||||
]
|
||||
variants = MusicBrainzService.build_variants(editions)
|
||||
assert [v["representative_release_mbid"] for v in variants] == ["orig1976", "reissue2014"]
|
||||
assert variants[0]["label"] == "Original"
|
||||
assert variants[0]["delta_vs_original"] == 0
|
||||
assert variants[1]["label"] == "Reissue"
|
||||
assert variants[1]["delta_vs_original"] == 2
|
||||
assert variants[1]["year"] == "2014"
|
||||
|
||||
def test_single_edition_is_one_original_variant(self):
|
||||
editions = [{"release_mbid": "only", "status": "Official", "date": "1990", "country": "GB", "track_count": 11}]
|
||||
variants = MusicBrainzService.build_variants(editions)
|
||||
assert len(variants) == 1
|
||||
assert variants[0]["label"] == "Original"
|
||||
assert variants[0]["pressing_count"] == 1
|
||||
|
||||
def test_no_editions_no_variants(self):
|
||||
assert MusicBrainzService.build_variants([]) == []
|
||||
|
||||
def test_editions_without_tracks_excluded(self):
|
||||
editions = [
|
||||
{"release_mbid": "real", "status": "Official", "date": "1976", "country": "US", "track_count": 10},
|
||||
{"release_mbid": "empty", "status": "Official", "date": "1976", "country": "GB", "track_count": 0},
|
||||
]
|
||||
variants = MusicBrainzService.build_variants(editions)
|
||||
assert len(variants) == 1
|
||||
assert variants[0]["representative_release_mbid"] == "real"
|
||||
|
||||
def test_preferred_countries_override_picks_representative(self):
|
||||
editions = [
|
||||
{"release_mbid": "us76", "status": "Official", "date": "1976", "country": "US", "track_count": 10},
|
||||
{"release_mbid": "jp76", "status": "Official", "date": "1976", "country": "JP", "track_count": 10},
|
||||
]
|
||||
variants = MusicBrainzService.build_variants(editions, preferred_countries=["JP"])
|
||||
assert variants[0]["representative_release_mbid"] == "jp76"
|
||||
|
||||
|
||||
class TestLocaleCountryPrefs:
|
||||
def test_english_locale_prefers_anglophone_countries(self):
|
||||
from backend.services.musicbrainz_service import country_prefs_for_locale
|
||||
assert country_prefs_for_locale("en") == ["GB", "US", "AU", "CA", "IE", "NZ"]
|
||||
|
||||
def test_region_suffix_is_stripped(self):
|
||||
from backend.services.musicbrainz_service import country_prefs_for_locale
|
||||
assert country_prefs_for_locale("en-US") == ["GB", "US", "AU", "CA", "IE", "NZ"]
|
||||
|
||||
def test_japanese_locale(self):
|
||||
from backend.services.musicbrainz_service import country_prefs_for_locale
|
||||
assert country_prefs_for_locale("ja") == ["JP"]
|
||||
|
||||
def test_unknown_and_none_fall_back_to_default(self):
|
||||
from backend.services.musicbrainz_service import country_prefs_for_locale
|
||||
default = ["XW", "XE", "US", "GB"]
|
||||
assert country_prefs_for_locale("zz") == default
|
||||
assert country_prefs_for_locale(None) == default
|
||||
assert country_prefs_for_locale("") == default
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
class TestServiceCalls:
|
||||
async def _svc_with(self, monkeypatch, responses):
|
||||
@@ -129,6 +211,14 @@ class TestServiceCalls:
|
||||
assert result["tracks"][0]["is_extra"] is False
|
||||
assert result["tracks"][2]["is_extra"] is True # the (Live) track
|
||||
assert len(result["editions"]) == 2
|
||||
# Variants: 3-track original + 5-track reissue; selected = canonical.
|
||||
variants = result["variants"]
|
||||
assert len(variants) == 2
|
||||
assert variants[0]["label"] == "Original"
|
||||
assert variants[0]["track_count"] == 3
|
||||
assert variants[1]["label"] == "Reissue"
|
||||
assert variants[1]["delta_vs_original"] == 2
|
||||
assert result["selected_variant_mbid"] == result["canonical_release_mbid"]
|
||||
|
||||
|
||||
import httpx as _httpx
|
||||
|
||||
@@ -397,9 +397,90 @@ class TestRetryEndpoint:
|
||||
file_urls={}
|
||||
)
|
||||
|
||||
# This job has no input audio - should not be retryable
|
||||
has_input = job.input_media_gcs_path or job.url
|
||||
assert not has_input
|
||||
# This job has no input audio - should not be retryable.
|
||||
# Restart-from-beginning is gated on audio actually being in GCS, NOT on
|
||||
# job.url (a URL whose download failed has no audio to re-fetch).
|
||||
has_input_audio_in_gcs = job.input_media_gcs_path
|
||||
assert not has_input_audio_in_gcs
|
||||
|
||||
|
||||
class TestRetryUrlJobWithoutDownload:
|
||||
"""Regression tests for the retry routing fix (incident: job 7f36304a).
|
||||
|
||||
A URL job whose download failed has `job.url` set but NO audio in GCS.
|
||||
Retrying it must NOT trigger the audio/lyrics workers (which would fail with
|
||||
"Failed to download audio file" and be retried by Cloud Run); it must refuse
|
||||
cleanly with a 400 telling the user to resubmit.
|
||||
"""
|
||||
|
||||
def _call_retry(self, job, mock_jm, mock_ws, background_tasks):
|
||||
import asyncio
|
||||
from backend.api.routes.jobs import retry_job
|
||||
|
||||
mock_jm.get_job.return_value = job
|
||||
mock_request = MagicMock()
|
||||
mock_request.headers = {}
|
||||
|
||||
async def _run():
|
||||
return await retry_job(
|
||||
job_id=job.job_id,
|
||||
request=mock_request,
|
||||
background_tasks=background_tasks,
|
||||
auth_result=MagicMock(is_admin=True, user_email="t@t.com"),
|
||||
)
|
||||
|
||||
with patch("backend.api.routes.jobs.job_manager", mock_jm), \
|
||||
patch("backend.api.routes.jobs.worker_service", mock_ws), \
|
||||
patch("backend.api.routes.jobs._check_job_ownership", return_value=True), \
|
||||
patch("backend.api.routes.jobs._is_auto_retry_pending", return_value=False), \
|
||||
patch("backend.api.routes.jobs.get_locale_from_request", return_value="en"):
|
||||
return asyncio.run(_run())
|
||||
|
||||
def _make_url_job(self, *, input_media_gcs_path=None):
|
||||
return Job(
|
||||
job_id="urljob1",
|
||||
status=JobStatus.FAILED,
|
||||
created_at=datetime.now(UTC),
|
||||
updated_at=datetime.now(UTC),
|
||||
artist="Hailey Whitters",
|
||||
title="Gone Country",
|
||||
url="https://music.apple.com/us/album/gone-country/1752594347?i=1752594711",
|
||||
input_media_gcs_path=input_media_gcs_path,
|
||||
file_urls={},
|
||||
)
|
||||
|
||||
def test_url_job_without_download_refuses_and_triggers_no_workers(self):
|
||||
"""URL job with no downloaded audio → 400 resubmit, no workers triggered."""
|
||||
from fastapi import HTTPException
|
||||
|
||||
job = self._make_url_job(input_media_gcs_path=None)
|
||||
mock_jm, mock_ws = MagicMock(), MagicMock()
|
||||
background_tasks = MagicMock()
|
||||
|
||||
with pytest.raises(HTTPException) as exc:
|
||||
self._call_retry(job, mock_jm, mock_ws, background_tasks)
|
||||
|
||||
assert exc.value.status_code == 400
|
||||
assert "resubmit" in str(exc.value.detail).lower()
|
||||
# The doomed workers must NOT have been scheduled.
|
||||
scheduled = [c.args[0] for c in background_tasks.add_task.call_args_list]
|
||||
assert mock_ws.trigger_audio_worker not in scheduled
|
||||
assert mock_ws.trigger_lyrics_worker not in scheduled
|
||||
|
||||
def test_url_job_with_downloaded_audio_restarts_from_beginning(self):
|
||||
"""URL job whose download succeeded (audio in GCS) → restarts + workers."""
|
||||
job = self._make_url_job(input_media_gcs_path="uploads/urljob1/audio/in.flac")
|
||||
mock_jm, mock_ws = MagicMock(), MagicMock()
|
||||
mock_jm.transition_to_state.return_value = True
|
||||
background_tasks = MagicMock()
|
||||
|
||||
result = self._call_retry(job, mock_jm, mock_ws, background_tasks)
|
||||
|
||||
assert result["status"] == "success"
|
||||
assert result["retry_stage"] == "from_beginning"
|
||||
scheduled = [c.args[0] for c in background_tasks.add_task.call_args_list]
|
||||
assert mock_ws.trigger_audio_worker in scheduled
|
||||
assert mock_ws.trigger_lyrics_worker in scheduled
|
||||
|
||||
|
||||
class TestCompleteReviewWithInstrumentalSelection:
|
||||
|
||||
@@ -83,6 +83,8 @@
|
||||
"invalidSelectionIndex": "Invalid selection index {selection_index}. Valid range: 0-{max}",
|
||||
"selectionError": "Error during audio selection for job {job_id}: {error}",
|
||||
"youtubeDownloadError": "YouTube download failed: {error}",
|
||||
"drmUrlUnsupported": "{platform} links are copy-protected, so we can't download them directly. Try downloading the audio with a third-party tool first, then upload the audio file here. You can also paste a YouTube link, or use Audio Search to find this song.",
|
||||
"drmUrlUnsupportedWithLink": "{platform} links are copy-protected, so we can't download them directly. You can download the track from {downloader}, then upload the audio file here. You can also paste a YouTube link, or use Audio Search to find this song.",
|
||||
"torrentDownloadError": "Cannot download from {source} without remote flacfetch service. Configure FLACFETCH_API_URL.",
|
||||
"remoteDownloadNoSearchId": "No source_id or remote_search_id available for {source} download",
|
||||
"remoteDownloadCompleteNoPath": "Remote download completed but no file path returned",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "خطأ في تحديد الصوت للمهمة {job_id}: {error}",
|
||||
"searchAudioError": "خطأ في البحث عن الصوت: {error}",
|
||||
"searchCreatedSuccessfully": "تم إنشاء المهمة. جاري البحث عن الصوت...",
|
||||
"autoDownloadStarted": "تم تحديد أفضل نتيجة تلقائيًا. جاري بدء التنزيل..."
|
||||
"autoDownloadStarted": "تم تحديد أفضل نتيجة تلقائيًا. جاري بدء التنزيل...",
|
||||
"drmUrlUnsupported": "روابط {platform} محمية بحقوق الطبع والنشر، لذا لا يمكننا تنزيلها مباشرة. حاول تنزيل الصوت باستخدام أداة خارجية أولاً، ثم قم برفع ملف الصوت هنا. يمكنك أيضاً لصق رابط YouTube، أو استخدام البحث الصوتي للعثور على هذه الأغنية.",
|
||||
"drmUrlUnsupportedWithLink": "روابط {platform} محمية بحقوق الطبع والنشر، لذا لا يمكننا تنزيلها مباشرة. يمكنك تنزيل المقطع الصوتي من {downloader}، ثم قم برفع ملف الصوت هنا. يمكنك أيضاً لصق رابط YouTube، أو استخدام البحث الصوتي للعثور على هذه الأغنية."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Error en seleccionar l'àudio per a la tasca {job_id}: {error}",
|
||||
"searchAudioError": "Error en cercar l'àudio: {error}",
|
||||
"searchCreatedSuccessfully": "Tasca creada. Cercant àudio...",
|
||||
"autoDownloadStarted": "Millor resultat seleccionat automàticament. Iniciant la descàrrega..."
|
||||
"autoDownloadStarted": "Millor resultat seleccionat automàticament. Iniciant la descàrrega...",
|
||||
"drmUrlUnsupported": "Els enllaços de {platform} estan protegits contra còpia, així que no els podem descarregar directament. Prova de descarregar l'àudio amb una eina de tercers primer i, a continuació, puja el fitxer d'àudio aquí. També pots enganxar un enllaç de YouTube o utilitzar la Cerca d'àudio per trobar aquesta cançó.",
|
||||
"drmUrlUnsupportedWithLink": "Els enllaços de {platform} estan protegits contra còpia, així que no els podem descarregar directament. Pots descarregar la pista des de {downloader} i, a continuació, pujar el fitxer d'àudio aquí. També pots enganxar un enllaç de YouTube o utilitzar la Cerca d'àudio per trobar aquesta cançó."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Chyba při výběru zvuku pro úlohu {job_id}: {error}",
|
||||
"searchAudioError": "Chyba při vyhledávání zvuku: {error}",
|
||||
"searchCreatedSuccessfully": "Úloha vytvořena. Vyhledávám zvuk...",
|
||||
"autoDownloadStarted": "Nejlepší výsledek byl vybrán automaticky. Začíná stahování..."
|
||||
"autoDownloadStarted": "Nejlepší výsledek byl vybrán automaticky. Začíná stahování...",
|
||||
"drmUrlUnsupported": "Odkazy z {platform} jsou chráněny proti kopírování, takže je nemůžeme stáhnout přímo. Zkus nejprve stáhnout zvuk pomocí nástroje třetí strany a poté sem nahraj zvukový soubor. Můžeš také vložit odkaz na YouTube nebo použít Audio Search k vyhledání této písně.",
|
||||
"drmUrlUnsupportedWithLink": "Odkazy z {platform} jsou chráněny proti kopírování, takže je nemůžeme stáhnout přímo. Skladbu si můžeš stáhnout z {downloader} a poté sem nahrát zvukový soubor. Můžeš také vložit odkaz na YouTube nebo použít Audio Search k vyhledání této písně."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Fejl ved valg af lyd for job {job_id}: {error}",
|
||||
"searchAudioError": "Fejl ved søgning efter lyd: {error}",
|
||||
"searchCreatedSuccessfully": "Jobbet er oprettet. Søger efter lyd...",
|
||||
"autoDownloadStarted": "Det bedste resultat blev valgt automatisk. Download starter..."
|
||||
"autoDownloadStarted": "Det bedste resultat blev valgt automatisk. Download starter...",
|
||||
"drmUrlUnsupported": "{platform}-links er kopibeskyttede, så vi kan ikke downloade dem direkte. Prøv at downloade lyden med et tredjepartsværktøj først, og upload derefter lydfilen her. Du kan også indsætte et YouTube-link eller bruge Audio Search til at finde denne sang.",
|
||||
"drmUrlUnsupportedWithLink": "{platform}-links er kopibeskyttede, så vi kan ikke downloade dem direkte. Du kan downloade nummeret fra {downloader} og derefter uploade lydfilen her. Du kan også indsætte et YouTube-link eller bruge Audio Search til at finde denne sang."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Fehler bei der Audioauswahl für Auftrag {job_id}: {error}",
|
||||
"searchAudioError": "Fehler bei der Audiosuche: {error}",
|
||||
"searchCreatedSuccessfully": "Auftrag erstellt. Suche nach Audio...",
|
||||
"autoDownloadStarted": "Bestes Ergebnis automatisch ausgewählt. Download startet..."
|
||||
"autoDownloadStarted": "Bestes Ergebnis automatisch ausgewählt. Download startet...",
|
||||
"drmUrlUnsupported": "{platform}-Links sind kopiergeschützt, daher können wir sie nicht direkt herunterladen. Versuche zuerst, das Audio mit einem Drittanbieter-Tool herunterzuladen, und lade die Audiodatei dann hier hoch. Du kannst auch einen YouTube-Link einfügen oder die Audiosuche verwenden, um diesen Song zu finden.",
|
||||
"drmUrlUnsupportedWithLink": "{platform}-Links sind kopiergeschützt, daher können wir sie nicht direkt herunterladen. Du kannst den Track von {downloader} herunterladen und die Audiodatei dann hier hochladen. Du kannst auch einen YouTube-Link einfügen oder die Audiosuche verwenden, um diesen Song zu finden."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Σφάλμα κατά την επιλογή ήχου για την εργασία {job_id}: {error}",
|
||||
"searchAudioError": "Σφάλμα κατά την αναζήτηση ήχου: {error}",
|
||||
"searchCreatedSuccessfully": "Η εργασία δημιουργήθηκε. Αναζήτηση για ήχο...",
|
||||
"autoDownloadStarted": "Το καλύτερο αποτέλεσμα επιλέχθηκε αυτόματα. Η λήψη ξεκινά..."
|
||||
"autoDownloadStarted": "Το καλύτερο αποτέλεσμα επιλέχθηκε αυτόματα. Η λήψη ξεκινά...",
|
||||
"drmUrlUnsupported": "Οι σύνδεσμοι του {platform} προστατεύονται από αντιγραφή, οπότε δεν μπορούμε να τους κατεβάσουμε απευθείας. Δοκίμασε να κατεβάσεις τον ήχο με ένα εργαλείο τρίτου πρώτα, και μετά ανέβασε το αρχείο ήχου εδώ. Μπορείς επίσης να επικολλήσεις έναν σύνδεσμο YouTube, ή να χρησιμοποιήσεις την Αναζήτηση Ήχου για να βρεις αυτό το τραγούδι.",
|
||||
"drmUrlUnsupportedWithLink": "Οι σύνδεσμοι του {platform} προστατεύονται από αντιγραφή, οπότε δεν μπορούμε να τους κατεβάσουμε απευθείας. Μπορείς να κατεβάσεις το κομμάτι από το {downloader}, και μετά να ανεβάσεις το αρχείο ήχου εδώ. Μπορείς επίσης να επικολλήσεις έναν σύνδεσμο YouTube, ή να χρησιμοποιήσεις την Αναζήτηση Ήχου για να βρεις αυτό το τραγούδι."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -83,6 +83,8 @@
|
||||
"invalidSelectionIndex": "Invalid selection index {selection_index}. Valid range: 0-{max}",
|
||||
"selectionError": "Error during audio selection for job {job_id}: {error}",
|
||||
"youtubeDownloadError": "YouTube download failed: {error}",
|
||||
"drmUrlUnsupported": "{platform} links are copy-protected, so we can't download them directly. Try downloading the audio with a third-party tool first, then upload the audio file here. You can also paste a YouTube link, or use Audio Search to find this song.",
|
||||
"drmUrlUnsupportedWithLink": "{platform} links are copy-protected, so we can't download them directly. You can download the track from {downloader}, then upload the audio file here. You can also paste a YouTube link, or use Audio Search to find this song.",
|
||||
"torrentDownloadError": "Cannot download from {source} without remote flacfetch service. Configure FLACFETCH_API_URL.",
|
||||
"remoteDownloadNoSearchId": "No source_id or remote_search_id available for {source} download",
|
||||
"remoteDownloadCompleteNoPath": "Remote download completed but no file path returned",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Error al seleccionar el audio para el trabajo {job_id}: {error}",
|
||||
"searchAudioError": "Error al buscar audio: {error}",
|
||||
"searchCreatedSuccessfully": "Trabajo creado. Buscando audio...",
|
||||
"autoDownloadStarted": "Mejor resultado seleccionado automáticamente. Iniciando descarga..."
|
||||
"autoDownloadStarted": "Mejor resultado seleccionado automáticamente. Iniciando descarga...",
|
||||
"drmUrlUnsupported": "Los enlaces de {platform} están protegidos contra copia, así que no podemos descargarlos directamente. Intenta descargar el audio con una herramienta de terceros primero, y luego sube el archivo de audio aquí. También puedes pegar un enlace de YouTube, o usar la Búsqueda de Audio para encontrar esta canción.",
|
||||
"drmUrlUnsupportedWithLink": "Los enlaces de {platform} están protegidos contra copia, así que no podemos descargarlos directamente. Puedes descargar la pista desde {downloader}, y luego subir el archivo de audio aquí. También puedes pegar un enlace de YouTube, o usar la Búsqueda de Audio para encontrar esta canción."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Virhe valittaessa ääntä työlle {job_id}: {error}",
|
||||
"searchAudioError": "Virhe haettaessa ääntä: {error}",
|
||||
"searchCreatedSuccessfully": "Työ luotu. Etsitään ääntä...",
|
||||
"autoDownloadStarted": "Paras tulos valittu automaattisesti. Lataus alkaa..."
|
||||
"autoDownloadStarted": "Paras tulos valittu automaattisesti. Lataus alkaa...",
|
||||
"drmUrlUnsupported": "{platform}-linkit ovat kopiosuojattuja, joten emme voi ladata niitä suoraan. Kokeile ladata ääni ensin kolmannen osapuolen työkalulla ja lataa äänitiedosto sitten tänne. Voit myös liittää YouTube-linkin tai etsiä tämän kappaleen Äänihaun avulla.",
|
||||
"drmUrlUnsupportedWithLink": "{platform}-linkit ovat kopiosuojattuja, joten emme voi ladata niitä suoraan. Voit ladata kappaleen palvelusta {downloader} ja ladata äänitiedoston sitten tänne. Voit myös liittää YouTube-linkin tai etsiä tämän kappaleen Äänihaun avulla."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Erreur lors de la sélection de l'audio pour la tâche {job_id} : {error}",
|
||||
"searchAudioError": "Erreur lors de la recherche audio : {error}",
|
||||
"searchCreatedSuccessfully": "Tâche créée. Recherche de l'audio en cours...",
|
||||
"autoDownloadStarted": "Meilleur résultat sélectionné automatiquement. Le téléchargement commence..."
|
||||
"autoDownloadStarted": "Meilleur résultat sélectionné automatiquement. Le téléchargement commence...",
|
||||
"drmUrlUnsupported": "Les liens {platform} sont protégés par le droit d'auteur, nous ne pouvons donc pas les télécharger directement. Essaie d'abord de télécharger l'audio avec un outil tiers, puis téléverse le fichier audio ici. Tu peux aussi coller un lien YouTube, ou utiliser la Recherche Audio pour trouver cette chanson.",
|
||||
"drmUrlUnsupportedWithLink": "Les liens {platform} sont protégés par le droit d'auteur, nous ne pouvons donc pas les télécharger directement. Tu peux télécharger le morceau depuis {downloader}, puis téléverser le fichier audio ici. Tu peux aussi coller un lien YouTube, ou utiliser la Recherche Audio pour trouver cette chanson."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "שגיאה בבחירת אודיו עבור המשימה {job_id}: {error}",
|
||||
"searchAudioError": "שגיאה בחיפוש אודיו: {error}",
|
||||
"searchCreatedSuccessfully": "המשימה נוצרה. מחפש אודיו...",
|
||||
"autoDownloadStarted": "התוצאה הטובה ביותר נבחרה אוטומטית. ההורדה מתחילה..."
|
||||
"autoDownloadStarted": "התוצאה הטובה ביותר נבחרה אוטומטית. ההורדה מתחילה...",
|
||||
"drmUrlUnsupported": "הקישורים של {platform} מוגנים מפני העתקה, ולכן איננו יכולים להוריד אותם ישירות. נסו להוריד את האודיו בעזרת כלי צד שלישי תחילה, ואז העלו את קובץ האודיו לכאן. תוכלו גם להדביק קישור ל-YouTube, או להשתמש בחיפוש אודיו כדי למצוא את השיר הזה.",
|
||||
"drmUrlUnsupportedWithLink": "הקישורים של {platform} מוגנים מפני העתקה, ולכן איננו יכולים להוריד אותם ישירות. תוכלו להוריד את הרצועה מ-{downloader}, ואז להעלות את קובץ האודיו לכאן. תוכלו גם להדביק קישור ל-YouTube, או להשתמש בחיפוש אודיו כדי למצוא את השיר הזה."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "जॉब {job_id} के लिए ऑडियो चुनने में त्रुटि: {error}",
|
||||
"searchAudioError": "ऑडियो खोजने में त्रुटि: {error}",
|
||||
"searchCreatedSuccessfully": "जॉब बन गई। ऑडियो खोजा जा रहा है...",
|
||||
"autoDownloadStarted": "सबसे अच्छा रिज़ल्ट अपने आप चुन लिया गया। डाउनलोड शुरू हो रहा है..."
|
||||
"autoDownloadStarted": "सबसे अच्छा रिज़ल्ट अपने आप चुन लिया गया। डाउनलोड शुरू हो रहा है...",
|
||||
"drmUrlUnsupported": "{platform} लिंक्स कॉपी-प्रोटेक्टेड हैं, इसलिए हम उन्हें सीधे डाउनलोड नहीं कर सकते। पहले किसी थर्ड-पार्टी टूल से ऑडियो डाउनलोड करने की कोशिश करो, फिर ऑडियो फ़ाइल को यहाँ अपलोड करो। तुम YouTube लिंक भी पेस्ट कर सकते हो, या इस गाने को खोजने के लिए Audio Search का उपयोग कर सकते हो।",
|
||||
"drmUrlUnsupportedWithLink": "{platform} लिंक्स कॉपी-प्रोटेक्टेड हैं, इसलिए हम उन्हें सीधे डाउनलोड नहीं कर सकते। तुम {downloader} से ट्रैक डाउनलोड कर सकते हो, फिर ऑडियो फ़ाइल को यहाँ अपलोड कर सकते हो। तुम YouTube लिंक भी पेस्ट कर सकते हो, या इस गाने को खोजने के लिए Audio Search का उपयोग कर सकते हो।"
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Pogreška pri odabiru zvuka za zadatak {job_id}: {error}",
|
||||
"searchAudioError": "Pogreška pri pretraživanju zvuka: {error}",
|
||||
"searchCreatedSuccessfully": "Zadatak je kreiran. Pretražujem zvuk...",
|
||||
"autoDownloadStarted": "Najbolji rezultat je automatski odabran. Preuzimanje započinje..."
|
||||
"autoDownloadStarted": "Najbolji rezultat je automatski odabran. Preuzimanje započinje...",
|
||||
"drmUrlUnsupported": "{platform} poveznice su zaštićene od kopiranja, pa ih ne možemo izravno preuzeti. Pokušaj prvo preuzeti zvuk pomoću alata treće strane, a zatim ovdje prenesi audio datoteku. Također možeš zalijepiti YouTube poveznicu ili koristiti pretraživanje zvuka da pronađeš ovu pjesmu.",
|
||||
"drmUrlUnsupportedWithLink": "{platform} poveznice su zaštićene od kopiranja, pa ih ne možemo izravno preuzeti. Možeš preuzeti pjesmu s {downloader}, a zatim ovdje prenijeti audio datoteku. Također možeš zalijepiti YouTube poveznicu ili koristiti pretraživanje zvuka da pronađeš ovu pjesmu."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Hiba a hang kiválasztásakor a(z) {job_id} feladatnál: {error}",
|
||||
"searchAudioError": "Hiba a hang keresésekor: {error}",
|
||||
"searchCreatedSuccessfully": "Feladat létrehozva. Hang keresése...",
|
||||
"autoDownloadStarted": "A legjobb eredmény automatikusan kiválasztva. Letöltés indítása..."
|
||||
"autoDownloadStarted": "A legjobb eredmény automatikusan kiválasztva. Letöltés indítása...",
|
||||
"drmUrlUnsupported": "A(z) {platform} linkek másolásvédettek, így nem tudjuk őket közvetlenül letölteni. Próbáld meg először letölteni a hanganyagot egy külső eszközzel, majd töltsd fel ide a hangfájlt. Beilleszthetsz egy YouTube linket is, vagy használd az Audio Search funkciót a dal megtalálásához.",
|
||||
"drmUrlUnsupportedWithLink": "A(z) {platform} linkek másolásvédettek, így nem tudjuk őket közvetlenül letölteni. Letöltheted a számot a(z) {downloader} segítségével, majd feltöltheted ide a hangfájlt. Beilleszthetsz egy YouTube linket is, vagy használd az Audio Search funkciót a dal megtalálásához."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Kesalahan saat memilih audio untuk tugas {job_id}: {error}",
|
||||
"searchAudioError": "Kesalahan saat mencari audio: {error}",
|
||||
"searchCreatedSuccessfully": "Tugas dibuat. Mencari audio...",
|
||||
"autoDownloadStarted": "Hasil terbaik dipilih secara otomatis. Unduhan dimulai..."
|
||||
"autoDownloadStarted": "Hasil terbaik dipilih secara otomatis. Unduhan dimulai...",
|
||||
"drmUrlUnsupported": "Tautan {platform} dilindungi hak cipta, jadi kami tidak dapat mengunduhnya secara langsung. Coba unduh audionya dengan alat pihak ketiga terlebih dahulu, lalu unggah file audionya di sini. Anda juga dapat menempelkan tautan YouTube, atau menggunakan Pencarian Audio untuk menemukan lagu ini.",
|
||||
"drmUrlUnsupportedWithLink": "Tautan {platform} dilindungi hak cipta, jadi kami tidak dapat mengunduhnya secara langsung. Anda dapat mengunduh lagu dari {downloader}, lalu mengunggah file audionya di sini. Anda juga dapat menempelkan tautan YouTube, atau menggunakan Pencarian Audio untuk menemukan lagu ini."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Errore durante la selezione dell'audio per il lavoro {job_id}: {error}",
|
||||
"searchAudioError": "Errore durante la ricerca dell'audio: {error}",
|
||||
"searchCreatedSuccessfully": "Lavoro creato. Ricerca dell'audio in corso...",
|
||||
"autoDownloadStarted": "Miglior risultato selezionato automaticamente. Avvio del download..."
|
||||
"autoDownloadStarted": "Miglior risultato selezionato automaticamente. Avvio del download...",
|
||||
"drmUrlUnsupported": "I link di {platform} sono protetti da copyright, quindi non possiamo scaricarli direttamente. Prova prima a scaricare l'audio con uno strumento di terze parti, poi carica il file audio qui. Puoi anche incollare un link di YouTube, oppure usare la Ricerca Audio per trovare questa canzone.",
|
||||
"drmUrlUnsupportedWithLink": "I link di {platform} sono protetti da copyright, quindi non possiamo scaricarli direttamente. Puoi scaricare la traccia da {downloader}, poi caricare il file audio qui. Puoi anche incollare un link di YouTube, oppure usare la Ricerca Audio per trovare questa canzone."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "ジョブ {job_id} のオーディオ選択中にエラーが発生しました: {error}",
|
||||
"searchAudioError": "オーディオの検索中にエラーが発生しました: {error}",
|
||||
"searchCreatedSuccessfully": "ジョブが作成されました。オーディオを検索しています...",
|
||||
"autoDownloadStarted": "最適な結果が自動的に選択されました。ダウンロードを開始します..."
|
||||
"autoDownloadStarted": "最適な結果が自動的に選択されました。ダウンロードを開始します...",
|
||||
"drmUrlUnsupported": "{platform}のリンクはコピー保護されているため、直接ダウンロードできません。サードパーティのツールでオーディオをダウンロードしてから、ここにアップロードしてみてください。または、YouTubeのリンクを貼り付けるか、オーディオ検索を使ってこの曲を探すこともできます。",
|
||||
"drmUrlUnsupportedWithLink": "{platform}のリンクはコピー保護されているため、直接ダウンロードできません。{downloader}からトラックをダウンロードし、そのオーディオファイルをここにアップロードすることができます。または、YouTubeのリンクを貼り付けるか、オーディオ検索を使ってこの曲を探すこともできます。"
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "使い捨てメールアドレスは許可されていません",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "작업 {job_id}의 오디오 선택 중 오류 발생: {error}",
|
||||
"searchAudioError": "오디오 검색 중 오류 발생: {error}",
|
||||
"searchCreatedSuccessfully": "작업이 생성되었습니다. 오디오를 검색하는 중...",
|
||||
"autoDownloadStarted": "가장 적합한 결과가 자동으로 선택되었습니다. 다운로드를 시작합니다..."
|
||||
"autoDownloadStarted": "가장 적합한 결과가 자동으로 선택되었습니다. 다운로드를 시작합니다...",
|
||||
"drmUrlUnsupported": "{platform} 링크는 복사 방지가 되어 있어 직접 다운로드할 수 없습니다. 먼저 타사 도구를 사용하여 오디오를 다운로드한 다음, 여기에 오디오 파일을 업로드해 보세요. YouTube 링크를 붙여넣거나 오디오 검색을 사용하여 이 노래를 찾을 수도 있습니다.",
|
||||
"drmUrlUnsupportedWithLink": "{platform} 링크는 복사 방지가 되어 있어 직접 다운로드할 수 없습니다. {downloader}에서 트랙을 다운로드한 다음, 여기에 오디오 파일을 업로드할 수 있습니다. YouTube 링크를 붙여넣거나 오디오 검색을 사용하여 이 노래를 찾을 수도 있습니다."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Ralat memilih audio untuk tugasan {job_id}: {error}",
|
||||
"searchAudioError": "Ralat mencari audio: {error}",
|
||||
"searchCreatedSuccessfully": "Tugasan dicipta. Sedang mencari audio...",
|
||||
"autoDownloadStarted": "Hasil terbaik dipilih secara automatik. Muat turun bermula..."
|
||||
"autoDownloadStarted": "Hasil terbaik dipilih secara automatik. Muat turun bermula...",
|
||||
"drmUrlUnsupported": "Pautan {platform} dilindungi hak cipta, jadi kami tidak dapat memuat turunnya secara terus. Cuba muat turun audio menggunakan alat pihak ketiga terlebih dahulu, kemudian muat naik fail audio di sini. Anda juga boleh menampal pautan YouTube, atau menggunakan Carian Audio untuk mencari lagu ini.",
|
||||
"drmUrlUnsupportedWithLink": "Pautan {platform} dilindungi hak cipta, jadi kami tidak dapat memuat turunnya secara terus. Anda boleh memuat turun trek tersebut dari {downloader}, kemudian muat naik fail audio di sini. Anda juga boleh menampal pautan YouTube, atau menggunakan Carian Audio untuk mencari lagu ini."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Feil ved valg av lyd for jobb {job_id}: {error}",
|
||||
"searchAudioError": "Feil ved søk etter lyd: {error}",
|
||||
"searchCreatedSuccessfully": "Jobb opprettet. Søker etter lyd...",
|
||||
"autoDownloadStarted": "Beste resultat valgt automatisk. Nedlasting starter..."
|
||||
"autoDownloadStarted": "Beste resultat valgt automatisk. Nedlasting starter...",
|
||||
"drmUrlUnsupported": "{platform}-lenker er kopibeskyttet, så vi kan ikke laste dem ned direkte. Prøv å laste ned lyden med et tredjepartsverktøy først, og last deretter opp lydfilen her. Du kan også lime inn en YouTube-lenke, eller bruke Lydsøk for å finne denne sangen.",
|
||||
"drmUrlUnsupportedWithLink": "{platform}-lenker er kopibeskyttet, så vi kan ikke laste dem ned direkte. Du kan laste ned sporet fra {downloader}, og deretter laste opp lydfilen her. Du kan også lime inn en YouTube-lenke, eller bruke Lydsøk for å finne denne sangen."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Fout bij het selecteren van audio voor taak {job_id}: {error}",
|
||||
"searchAudioError": "Fout bij het zoeken naar audio: {error}",
|
||||
"searchCreatedSuccessfully": "Taak aangemaakt. Zoeken naar audio...",
|
||||
"autoDownloadStarted": "Beste resultaat automatisch geselecteerd. Downloaden wordt gestart..."
|
||||
"autoDownloadStarted": "Beste resultaat automatisch geselecteerd. Downloaden wordt gestart...",
|
||||
"drmUrlUnsupported": "{platform}-links zijn kopieerbeveiligd, dus we kunnen ze niet direct downloaden. Probeer de audio eerst te downloaden met een externe tool en upload het audiobestand vervolgens hier. Je kunt ook een YouTube-link plakken, of Audio Search gebruiken om dit nummer te vinden.",
|
||||
"drmUrlUnsupportedWithLink": "{platform}-links zijn kopieerbeveiligd, dus we kunnen ze niet direct downloaden. Je kunt het nummer downloaden via {downloader} en vervolgens het audiobestand hier uploaden. Je kunt ook een YouTube-link plakken, of Audio Search gebruiken om dit nummer te vinden."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Błąd podczas wybierania audio dla zadania {job_id}: {error}",
|
||||
"searchAudioError": "Błąd podczas wyszukiwania audio: {error}",
|
||||
"searchCreatedSuccessfully": "Zadanie utworzone. Wyszukiwanie audio...",
|
||||
"autoDownloadStarted": "Najlepszy wynik wybrany automatycznie. Rozpoczynanie pobierania..."
|
||||
"autoDownloadStarted": "Najlepszy wynik wybrany automatycznie. Rozpoczynanie pobierania...",
|
||||
"drmUrlUnsupported": "Linki z {platform} są chronione przed kopiowaniem, więc nie możemy ich pobrać bezpośrednio. Spróbuj najpierw pobrać dźwięk za pomocą zewnętrznego narzędzia, a następnie prześlij plik audio tutaj. Możesz też wkleić link do YouTube lub użyć wyszukiwania audio, aby znaleźć tę piosenkę.",
|
||||
"drmUrlUnsupportedWithLink": "Linki z {platform} są chronione przed kopiowaniem, więc nie możemy ich pobrać bezpośrednio. Możesz pobrać utwór z {downloader}, a następnie przesłać plik audio tutaj. Możesz też wkleić link do YouTube lub użyć wyszukiwania audio, aby znaleźć tę piosenkę."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Erro ao selecionar áudio para o job {job_id}: {error}",
|
||||
"searchAudioError": "Erro ao pesquisar áudio: {error}",
|
||||
"searchCreatedSuccessfully": "Job criado. Pesquisando áudio...",
|
||||
"autoDownloadStarted": "Melhor resultado selecionado automaticamente. Iniciando download..."
|
||||
"autoDownloadStarted": "Melhor resultado selecionado automaticamente. Iniciando download...",
|
||||
"drmUrlUnsupported": "Os links do {platform} são protegidos contra cópia, então não podemos baixá-los diretamente. Tente baixar o áudio com uma ferramenta de terceiros primeiro e depois faça o upload do arquivo de áudio aqui. Você também pode colar um link do YouTube ou usar a Pesquisa de Áudio para encontrar esta música.",
|
||||
"drmUrlUnsupportedWithLink": "Os links do {platform} são protegidos contra cópia, então não podemos baixá-los diretamente. Você pode baixar a faixa do {downloader} e depois fazer o upload do arquivo de áudio aqui. Você também pode colar um link do YouTube ou usar a Pesquisa de Áudio para encontrar esta música."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Eroare la selectarea fișierului audio pentru jobul {job_id}: {error}",
|
||||
"searchAudioError": "Eroare la căutarea audio: {error}",
|
||||
"searchCreatedSuccessfully": "Job creat. Se caută fișierul audio...",
|
||||
"autoDownloadStarted": "Cel mai bun rezultat a fost selectat automat. Descărcarea începe..."
|
||||
"autoDownloadStarted": "Cel mai bun rezultat a fost selectat automat. Descărcarea începe...",
|
||||
"drmUrlUnsupported": "Linkurile {platform} sunt protejate la copiere, așa că nu le putem descărca direct. Încearcă să descarci mai întâi conținutul audio cu un instrument terț, apoi încarcă fișierul audio aici. De asemenea, poți lipi un link YouTube sau poți folosi Căutare Audio pentru a găsi această melodie.",
|
||||
"drmUrlUnsupportedWithLink": "Linkurile {platform} sunt protejate la copiere, așa că nu le putem descărca direct. Poți descărca piesa de pe {downloader}, apoi încarcă fișierul audio aici. De asemenea, poți lipi un link YouTube sau poți folosi Căutare Audio pentru a găsi această melodie."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Ошибка при выборе аудио для задачи {job_id}: {error}",
|
||||
"searchAudioError": "Ошибка при поиске аудио: {error}",
|
||||
"searchCreatedSuccessfully": "Задача создана. Ищем аудио...",
|
||||
"autoDownloadStarted": "Лучший результат выбран автоматически. Начинается скачивание..."
|
||||
"autoDownloadStarted": "Лучший результат выбран автоматически. Начинается скачивание...",
|
||||
"drmUrlUnsupported": "Ссылки {platform} защищены от копирования, поэтому мы не можем скачать их напрямую. Попробуй сначала скачать аудио с помощью стороннего инструмента, а затем загрузи аудиофайл сюда. Ты также можешь вставить ссылку на YouTube или использовать Поиск аудио, чтобы найти эту песню.",
|
||||
"drmUrlUnsupportedWithLink": "Ссылки {platform} защищены от копирования, поэтому мы не можем скачать их напрямую. Ты можешь скачать трек с {downloader}, а затем загрузить аудиофайл сюда. Ты также можешь вставить ссылку на YouTube или использовать Поиск аудио, чтобы найти эту песню."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Chyba pri výbere zvuku pre úlohu {job_id}: {error}",
|
||||
"searchAudioError": "Chyba pri vyhľadávaní zvuku: {error}",
|
||||
"searchCreatedSuccessfully": "Úloha bola vytvorená. Vyhľadáva sa zvuk...",
|
||||
"autoDownloadStarted": "Najlepší výsledok bol vybraný automaticky. Sťahovanie sa začína..."
|
||||
"autoDownloadStarted": "Najlepší výsledok bol vybraný automaticky. Sťahovanie sa začína...",
|
||||
"drmUrlUnsupported": "Odkazy {platform} sú chránené proti kopírovaniu, takže ich nemôžeme stiahnuť priamo. Skús najprv stiahnuť zvuk pomocou nástroja tretej strany a potom sem nahraj zvukový súbor. Môžeš tiež vložiť odkaz na YouTube alebo použiť vyhľadávanie zvuku na nájdenie tejto piesne.",
|
||||
"drmUrlUnsupportedWithLink": "Odkazy {platform} sú chránené proti kopírovaniu, takže ich nemôžeme stiahnuť priamo. Skladbu si môžeš stiahnuť z {downloader} a potom sem nahrať zvukový súbor. Môžeš tiež vložiť odkaz na YouTube alebo použiť vyhľadávanie zvuku na nájdenie tejto piesne."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Fel vid val av ljud för jobb {job_id}: {error}",
|
||||
"searchAudioError": "Fel vid sökning efter ljud: {error}",
|
||||
"searchCreatedSuccessfully": "Jobbet har skapats. Söker efter ljud...",
|
||||
"autoDownloadStarted": "Bästa resultatet valdes automatiskt. Nedladdningen startar..."
|
||||
"autoDownloadStarted": "Bästa resultatet valdes automatiskt. Nedladdningen startar...",
|
||||
"drmUrlUnsupported": "{platform}-länkar är kopieringsskyddade, så vi kan inte ladda ner dem direkt. Försök att ladda ner ljudet med ett tredjepartsverktyg först och ladda sedan upp ljudfilen här. Du kan också klistra in en YouTube-länk eller använda Ljudsökning för att hitta den här låten.",
|
||||
"drmUrlUnsupportedWithLink": "{platform}-länkar är kopieringsskyddade, så vi kan inte ladda ner dem direkt. Du kan ladda ner spåret från {downloader} och sedan ladda upp ljudfilen här. Du kan också klistra in en YouTube-länk eller använda Ljudsökning för att hitta den här låten."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "เกิดข้อผิดพลาดในการเลือกเสียงสำหรับงาน {job_id}: {error}",
|
||||
"searchAudioError": "เกิดข้อผิดพลาดในการค้นหาเสียง: {error}",
|
||||
"searchCreatedSuccessfully": "สร้างงานแล้ว กำลังค้นหาเสียง...",
|
||||
"autoDownloadStarted": "เลือกผลลัพธ์ที่ดีที่สุดโดยอัตโนมัติ กำลังเริ่มดาวน์โหลด..."
|
||||
"autoDownloadStarted": "เลือกผลลัพธ์ที่ดีที่สุดโดยอัตโนมัติ กำลังเริ่มดาวน์โหลด...",
|
||||
"drmUrlUnsupported": "ลิงก์ของ {platform} มีการป้องกันการคัดลอก เราจึงไม่สามารถดาวน์โหลดได้โดยตรง ลองดาวน์โหลดเสียงด้วยเครื่องมือของบุคคลที่สามก่อน แล้วจึงอัปโหลดไฟล์เสียงที่นี่ คุณยังสามารถวางลิงก์ YouTube หรือใช้ Audio Search เพื่อค้นหาเพลงนี้ได้อีกด้วย",
|
||||
"drmUrlUnsupportedWithLink": "ลิงก์ของ {platform} มีการป้องกันการคัดลอก เราจึงไม่สามารถดาวน์โหลดได้โดยตรง คุณสามารถดาวน์โหลดแทร็กจาก {downloader} แล้วจึงอัปโหลดไฟล์เสียงที่นี่ คุณยังสามารถวางลิงก์ YouTube หรือใช้ Audio Search เพื่อค้นหาเพลงนี้ได้อีกด้วย"
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Error sa pagpili ng audio para sa job {job_id}: {error}",
|
||||
"searchAudioError": "Error sa paghahanap ng audio: {error}",
|
||||
"searchCreatedSuccessfully": "Nagawa na ang job. Naghahanap ng audio...",
|
||||
"autoDownloadStarted": "Awtomatikong napili ang pinakamagandang resulta. Nagsisimula na ang pag-download..."
|
||||
"autoDownloadStarted": "Awtomatikong napili ang pinakamagandang resulta. Nagsisimula na ang pag-download...",
|
||||
"drmUrlUnsupported": "Ang mga link ng {platform} ay copy-protected, kaya hindi namin ito direktang ma-download. Subukan munang i-download ang audio gamit ang isang third-party na tool, pagkatapos ay i-upload ang audio file dito. Maaari ka ring mag-paste ng YouTube link, o gamitin ang Audio Search para hanapin ang kantang ito.",
|
||||
"drmUrlUnsupportedWithLink": "Ang mga link ng {platform} ay copy-protected, kaya hindi namin ito direktang ma-download. Maaari mong i-download ang track mula sa {downloader}, pagkatapos ay i-upload ang audio file dito. Maaari ka ring mag-paste ng YouTube link, o gamitin ang Audio Search para hanapin ang kantang ito."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "{job_id} işi için ses seçme hatası: {error}",
|
||||
"searchAudioError": "Ses arama hatası: {error}",
|
||||
"searchCreatedSuccessfully": "İş oluşturuldu. Ses aranıyor...",
|
||||
"autoDownloadStarted": "En iyi sonuç otomatik olarak seçildi. İndirme başlıyor..."
|
||||
"autoDownloadStarted": "En iyi sonuç otomatik olarak seçildi. İndirme başlıyor...",
|
||||
"drmUrlUnsupported": "{platform} bağlantıları kopya korumalı olduğu için onları doğrudan indiremiyoruz. Sesi önce üçüncü taraf bir araçla indirmeyi dene, ardından ses dosyasını buraya yükle. Ayrıca bir YouTube bağlantısı yapıştırabilir veya bu şarkıyı bulmak için Ses Arama'yı kullanabilirsin.",
|
||||
"drmUrlUnsupportedWithLink": "{platform} bağlantıları kopya korumalı olduğu için onları doğrudan indiremiyoruz. Parçayı {downloader} üzerinden indirebilir, ardından ses dosyasını buraya yükleyebilirsin. Ayrıca bir YouTube bağlantısı yapıştırabilir veya bu şarkıyı bulmak için Ses Arama'yı kullanabilirsin."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Помилка вибору аудіо для завдання {job_id}: {error}",
|
||||
"searchAudioError": "Помилка пошуку аудіо: {error}",
|
||||
"searchCreatedSuccessfully": "Завдання створено. Шукаємо аудіо...",
|
||||
"autoDownloadStarted": "Найкращий результат вибрано автоматично. Починається завантаження..."
|
||||
"autoDownloadStarted": "Найкращий результат вибрано автоматично. Починається завантаження...",
|
||||
"drmUrlUnsupported": "Посилання {platform} захищені від копіювання, тому ми не можемо завантажити їх безпосередньо. Спробуй спочатку завантажити аудіо за допомогою стороннього інструменту, а потім завантаж аудіофайл сюди. Ти також можеш вставити посилання на YouTube або скористатися пошуком аудіо, щоб знайти цю пісню.",
|
||||
"drmUrlUnsupportedWithLink": "Посилання {platform} захищені від копіювання, тому ми не можемо завантажити їх безпосередньо. Ти можеш завантажити трек з {downloader}, а потім завантажити аудіофайл сюди. Ти також можеш вставити посилання на YouTube або скористатися пошуком аудіо, щоб знайти цю пісню."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "Lỗi khi chọn âm thanh cho công việc {job_id}: {error}",
|
||||
"searchAudioError": "Lỗi khi tìm kiếm âm thanh: {error}",
|
||||
"searchCreatedSuccessfully": "Đã tạo công việc. Đang tìm kiếm âm thanh...",
|
||||
"autoDownloadStarted": "Kết quả tốt nhất được chọn tự động. Đang bắt đầu tải xuống..."
|
||||
"autoDownloadStarted": "Kết quả tốt nhất được chọn tự động. Đang bắt đầu tải xuống...",
|
||||
"drmUrlUnsupported": "Các liên kết {platform} được bảo vệ bản quyền, vì vậy chúng tôi không thể tải chúng xuống trực tiếp. Hãy thử tải âm thanh bằng công cụ của bên thứ ba trước, sau đó tải tệp âm thanh lên đây. Bạn cũng có thể dán liên kết YouTube hoặc sử dụng Tìm kiếm Âm thanh để tìm bài hát này.",
|
||||
"drmUrlUnsupportedWithLink": "Các liên kết {platform} được bảo vệ bản quyền, vì vậy chúng tôi không thể tải chúng xuống trực tiếp. Bạn có thể tải bản nhạc từ {downloader}, sau đó tải tệp âm thanh lên đây. Bạn cũng có thể dán liên kết YouTube hoặc sử dụng Tìm kiếm Âm thanh để tìm bài hát này."
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "disposable_email_not_allowed",
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"selectAudioError": "为任务 {job_id} 选择音频时出错:{error}",
|
||||
"searchAudioError": "搜索音频时出错:{error}",
|
||||
"searchCreatedSuccessfully": "任务已创建。正在搜索音频...",
|
||||
"autoDownloadStarted": "已自动选择最佳结果。开始下载..."
|
||||
"autoDownloadStarted": "已自动选择最佳结果。开始下载...",
|
||||
"drmUrlUnsupported": "{platform} 链接受版权保护,因此我们无法直接下载。请先尝试使用第三方工具下载音频,然后在此处上传音频文件。您也可以粘贴 YouTube 链接,或者使用音频搜索来查找这首歌。",
|
||||
"drmUrlUnsupportedWithLink": "{platform} 链接受版权保护,因此我们无法直接下载。您可以从 {downloader} 下载该曲目,然后在此处上传音频文件。您也可以粘贴 YouTube 链接,或者使用音频搜索来查找这首歌。"
|
||||
},
|
||||
"users": {
|
||||
"disposableEmailBlocked": "不允许使用一次性邮箱",
|
||||
|
||||
+2
-2
@@ -2279,11 +2279,11 @@ routes require auth.
|
||||
|
||||
- `GET /api/bulk/album/artists?q=<name>` → `[{mbid,name,disambiguation,type,country}]`
|
||||
- `GET /api/bulk/album/albums?artist_mbid=<mbid>` → `[{release_group_mbid,title,primary_type,secondary_types,first_release_date,is_studio}]` (studio albums first)
|
||||
- `GET /api/bulk/album/tracklist?artist=<name>&release_group_mbid=<mbid>` (or `&release_mbid=<mbid>` for a specific edition) → `{release_mbid,canonical_release_mbid,title,date,tracks:[{position,title,recording_mbid,length_ms,is_extra,extra_reason,available,brands}],editions:[{release_mbid,title,status,date,country,track_count}]}`. Each track is enriched with KaraokeNerds community-version availability (`available`/`brands`); enrichment is best-effort and never fatal.
|
||||
- `GET /api/bulk/album/tracklist?artist=<name>&release_group_mbid=<mbid>` (or `&release_mbid=<mbid>` for a specific edition; optional `&locale=<code>` biases representative-pressing choice) → `{release_mbid,canonical_release_mbid,selected_variant_mbid,title,date,tracks:[{position,title,recording_mbid,length_ms,is_extra,extra_reason,available,brands,versions:[{brand,url}]}],editions:[{release_mbid,title,status,date,country,track_count}],variants:[{representative_release_mbid,label,track_count,year,pressing_count,delta_vs_original}]}`. `variants` collapses the release-group's country pressings into distinct tracklists grouped by track count (label `Original`/`Reissue`, `Original` = earliest); load one via its `representative_release_mbid` as `release_mbid`. Each track is enriched with KaraokeNerds community-version availability — `available`/`brands` plus `versions` (per-version `{brand,url}` YouTube links for clickable preview); enrichment is best-effort and never fatal.
|
||||
|
||||
### Availability (text mode)
|
||||
|
||||
- `POST /api/bulk/availability` body `{tracks:[{artist,title}]}` (≤100) → `{results:[{artist,title,available,brands,brand_count}]}`. Backed by the existing KaraokeNerds community-version scraper (1h cache, bounded concurrency).
|
||||
- `POST /api/bulk/availability` body `{tracks:[{artist,title}]}` (≤100) → `{results:[{artist,title,available,brands,brand_count,versions:[{brand,url}]}]}`. Backed by the existing KaraokeNerds community-version scraper (1h cache, bounded concurrency). `versions` carries per-version YouTube links for clickable preview.
|
||||
|
||||
### Submit
|
||||
|
||||
|
||||
@@ -0,0 +1,221 @@
|
||||
# Bulk Mode — Edition Collapse + Community-Versions Redesign (Design)
|
||||
|
||||
**Date:** 2026-06-22
|
||||
**Branch:** `feat/sess-20260622-0041-bulk-release-selection`
|
||||
**Scope:** karaoke-gen Bulk Mode "By album" + "By text" flows, against **live MusicBrainz** (no
|
||||
mirror dependency).
|
||||
|
||||
## Context
|
||||
|
||||
Bulk Mode lets a user submit up to 100 karaoke jobs at once. The "By album" flow searches
|
||||
MusicBrainz, picks a release, and shows a tracklist with checkboxes + community-version badges.
|
||||
Two UX problems, both visible in production:
|
||||
|
||||
1. **The edition dropdown is noise.** For ABBA *Arrival* it showed ~17 editions, most of which were
|
||||
the *same* 1976 10-track album pressed in different countries (US/AU/SE/NL/DE…). The selection's
|
||||
only job is to produce a list of **track names** for submission — the country of pressing is
|
||||
irrelevant to that.
|
||||
2. **The community-version badge is wide and inert.** It renders
|
||||
`Community version: SNDL Karaoke, Nomad Karaoke, Reekies Karaoke` inline, which grows
|
||||
horizontally with the number of brands and is not clickable — the user can't preview a version to
|
||||
decide whether it's good enough or whether to remake it.
|
||||
|
||||
This is the **near-term, live-MB** improvement. The larger mirror-backed upgrade (exact
|
||||
tracklist-signature grouping + popularity ranking) is captured separately in
|
||||
`../../../docs/archive/2026-06-18-musicbrainz-mirror-and-album-ux-handoff.md` (Part 3a, Option 2)
|
||||
and is **out of scope here**.
|
||||
|
||||
## Goals
|
||||
|
||||
- Collapse the edition list into a handful of distinct **tracklist variants**, not country pressings.
|
||||
- Make the common case a single confident default; hide the choice behind "Change".
|
||||
- Show **track numbers**.
|
||||
- Replace the community-version badge with a **vertical, clickable** list of versions, each linking
|
||||
to its YouTube video so the user can preview it.
|
||||
|
||||
## Non-goals
|
||||
|
||||
- The MusicBrainz mirror (decide) and anything that depends on it (exact signature grouping,
|
||||
popularity-based auto-select). Tracked in the handoff doc.
|
||||
- Changing how jobs are submitted, credited, or processed downstream.
|
||||
- Fetching per-edition tracklists to compare them (would trip MB's egress rate limiter — explicitly
|
||||
avoided; see Option 1 rationale).
|
||||
|
||||
---
|
||||
|
||||
## Feature 1 — Edition selection: collapse to tracklist variants (A + C)
|
||||
|
||||
### Model
|
||||
- **A — collapse to variants.** Group the release-group's official editions into distinct tracklist
|
||||
variants. Present only meaningfully-different tracklists. Country is no longer the headline.
|
||||
- **C — single default, choice hidden.** Show one line; reveal the variant list only on *Change*; if
|
||||
there's a single variant, no Change affordance at all.
|
||||
|
||||
### Grouping key — Option 1 (track count)
|
||||
Group official editions by `track_count`. Within a single release-group, same track count ≈ same
|
||||
songs (reissues *add* tracks ⇒ a different count), so this is ~95% correct with **zero extra MB API
|
||||
calls** (`_list_editions()` already returns `track_count` per edition). Known, accepted gap: a rare
|
||||
reissue that swaps one track 1-for-1 (same count, different song) would merge incorrectly — the user
|
||||
still sees the full tracklist before submitting. Tracklists stay **lazy-fetched** only for the
|
||||
selected variant, exactly as today.
|
||||
|
||||
> Rationale for not fetching every edition's tracklist: MusicBrainz rate-limits hard from Cloud Run
|
||||
> egress (we've hit 503s and added retry/backoff). Comparing 17 editions = 17 extra calls per album,
|
||||
> in a flow where users look up many albums. The exact-signature approach waits for the mirror.
|
||||
|
||||
### Backend (`backend/services/musicbrainz_service.py`, `backend/api/routes/bulk.py`)
|
||||
|
||||
`get_album_tracklist(release_group_mbid)` already runs `_list_editions()` →
|
||||
`pick_canonical_edition()` → `get_release_tracklist(canonical)`. Add a variant-building step after
|
||||
`_list_editions()`:
|
||||
|
||||
1. Filter to `status == "Official"` (mirrors `pick_canonical_edition`).
|
||||
2. Group by `track_count`.
|
||||
3. For each group, choose a **representative release** using the existing canonical heuristic scoped
|
||||
to the group: earliest date, then locale-preferred country (see Locale), then a stable fallback.
|
||||
4. Compute each group's earliest year (for display) and `pressing_count` (how many editions
|
||||
collapsed in).
|
||||
5. **Label** variants:
|
||||
- The group with the overall-earliest date → `label = "Original"`.
|
||||
- Other groups → labeled by track-count delta vs the Original: more tracks ⇒ `"+N tracks"`
|
||||
(rendered as e.g. "Reissue · +2 tracks"); fewer ⇒ `"-N tracks"`. Year disambiguates.
|
||||
6. Sort variants: Original first, then by year ascending.
|
||||
|
||||
The **default** tracklist remains the canonical release = the Original variant's representative
|
||||
(no behavior change to the default load). Switching variants on the frontend reuses the **existing**
|
||||
`GET /album/tracklist?release_mbid=<representative_release_mbid>` path — no new endpoint.
|
||||
|
||||
New response field on `BulkTracklistResponse`:
|
||||
|
||||
```python
|
||||
class BulkEditionVariant(BaseModel):
|
||||
representative_release_mbid: str
|
||||
label: str # "Original" | "Reissue" | derived
|
||||
track_count: int
|
||||
year: str = "" # earliest year in the group, e.g. "1976"
|
||||
pressing_count: int = 0
|
||||
delta_vs_original: int = 0 # track_count - original.track_count
|
||||
|
||||
class BulkTracklistResponse(BaseModel):
|
||||
...
|
||||
variants: list[BulkEditionVariant] = []
|
||||
selected_variant_mbid: Optional[str] = None # which variant the returned tracklist belongs to
|
||||
```
|
||||
|
||||
`editions[]` may stay for back-compat but is no longer the primary UI input. `selected_variant_mbid`
|
||||
lets the frontend highlight the active variant after a switch.
|
||||
|
||||
### Locale
|
||||
The frontend passes the active locale (`useLocale()` from next-intl) to `/album/tracklist`
|
||||
(e.g. `?locale=en`). Backend maps locale → ordered country-preference list used in the
|
||||
representative pick, falling back to today's `[XW, XE, US, GB]`:
|
||||
|
||||
| locale prefix | preferred countries |
|
||||
|---|---|
|
||||
| en | GB, US, AU, CA, IE, NZ |
|
||||
| ja | JP |
|
||||
| de | DE, AT, CH |
|
||||
| ko | KR |
|
||||
| es | ES, MX, AR |
|
||||
| fr | FR, CA, BE |
|
||||
| (other / unknown) | XW, XE, US, GB |
|
||||
|
||||
Under Option 1 this mostly affects *which pressing backs a variant*, not which variant is default
|
||||
(Original/earliest is always default). It wires the hook the mirror era will lean on.
|
||||
|
||||
### Frontend (`frontend/components/job/bulk/BulkAlbumMode.tsx`, `lib/api.ts`, `bulk/types.ts`)
|
||||
- Replace the raw editions `<Select>` with the **C** pattern:
|
||||
- One summary line: *"Using the {label} {year} release · {N} tracks"* + a **Change** button.
|
||||
- **Change** opens the variant list (reuse `<Select>` / a small popover) showing each variant's
|
||||
label, year, track count, and (subtly) pressing_count. Selecting one calls the existing
|
||||
`release_mbid` fetch.
|
||||
- If `variants.length <= 1`, render the summary line **without** a Change affordance.
|
||||
- **Track numbers:** prefix each track row with `position` (e.g. `1.`). Data already present on
|
||||
`BulkTrack.position`; currently unrendered. Hide if `position` is null.
|
||||
|
||||
---
|
||||
|
||||
## Feature 2 — Community versions: vertical, clickable list
|
||||
|
||||
### Data — stop discarding `youtube_url`
|
||||
`_parse_single_track()` in `karaokenerds_service.py` already captures
|
||||
`{brand_name, brand_code, youtube_url, is_community}`. `check_community_versions_batch()` flattens it
|
||||
to `brands: [str]`, dropping the URL. Enrich it to also return per-version objects:
|
||||
|
||||
```python
|
||||
# per result, in addition to existing available/brands/brand_count:
|
||||
"versions": [{"brand": brand_name, "url": youtube_url}, ...]
|
||||
```
|
||||
|
||||
Dedup by `brand` (first community `youtube_url` per brand). `brands`/`brand_count` retained for
|
||||
back-compat (existing tests, any other consumers).
|
||||
|
||||
### Backend plumbing (`backend/api/routes/bulk.py`)
|
||||
- `BulkTrack`: add `versions: list[CommunityVersion] = []` where
|
||||
`CommunityVersion = {brand: str, url: str}`.
|
||||
- `AvailabilityResult`: add `versions: list[CommunityVersion] = []`.
|
||||
- `/album/tracklist`: set `t["versions"] = a["versions"]` in the enrichment loop.
|
||||
- `/availability` (text mode): pass `versions` through.
|
||||
|
||||
### Frontend (`frontend/components/job/bulk/AvailabilityBadge.tsx` → versions list)
|
||||
Replace the single wide badge with a vertical block when `available && versions.length`:
|
||||
|
||||
```
|
||||
Existing versions:
|
||||
▶ SNDL Karaoke (anchor → version.url, target=_blank rel="noopener noreferrer")
|
||||
▶ Nomad Karaoke
|
||||
▶ Reekies Karaoke
|
||||
```
|
||||
|
||||
- lucide `Youtube` icon per row.
|
||||
- **Show all versions, always** (no cap/expander) — multiple community versions of one song is rare;
|
||||
vertical layout already solves the original width problem.
|
||||
- Each row is a link opening the YouTube video in a new tab; clicking it must **not** toggle the
|
||||
track checkbox.
|
||||
- Fallback: if `available` but `versions` is empty (shouldn't happen — a community track always has a
|
||||
URL), render the existing plain "Community version exists" text.
|
||||
- Shared by album and text modes (both render this component).
|
||||
|
||||
Track-selection default logic is unchanged: tracks with `is_extra` or `available` start **unticked**
|
||||
(`shouldSelectTrack` in `types.ts`).
|
||||
|
||||
---
|
||||
|
||||
## i18n
|
||||
Per workspace policy, any `messages/en.json` change ships with all 33 locales.
|
||||
- New/changed keys (bulk namespace): `existingVersions` ("Existing versions:"),
|
||||
`usingRelease` ("Using the {label} {year} release · {count} tracks"), `changeEdition` ("Change"),
|
||||
`variantOriginal` ("Original"), `variantReissue` ("Reissue"), `variantTrackDelta` ("+{n} tracks").
|
||||
- Remove now-unused `communityExistsWithBrands` only if no other consumer references it.
|
||||
- Run `python scripts/translate.py --messages-dir ./messages --target all` before the PR.
|
||||
|
||||
## Testing
|
||||
- **Backend unit (`musicbrainz_service`):** variant grouping — multiple same-track-count editions
|
||||
collapse to one variant; differing counts → separate variants; Original = earliest; representative
|
||||
pick honors locale country preference then falls back; single-edition album → one variant.
|
||||
- **Backend unit (`karaokenerds_service`):** `check_community_versions_batch` returns `versions` with
|
||||
brand+url, deduped by brand; still returns `brands`/`brand_count`; failed lookup → empty, never
|
||||
raises. Parser test: a `<li class="track">` with a YouTube href yields `youtube_url`.
|
||||
- **Backend API (`bulk.py`):** `/album/tracklist` response includes `variants` and per-track
|
||||
`versions`; `/availability` includes `versions`. Add a regression test that `variants` and the new
|
||||
fields survive the Pydantic round-trip.
|
||||
- **Frontend:** AvailabilityBadge renders one anchor per version with correct href + `target=_blank`;
|
||||
clicking a version link does not toggle the checkbox; edition summary line + Change toggle; track
|
||||
numbers rendered from `position`; single-variant hides Change.
|
||||
|
||||
## Risk / rollback
|
||||
- Pure additive backend fields + frontend rendering swap; no job-submission or money-path changes.
|
||||
- Option 1's merge edge case (1-for-1 track swap) is visible to the user before submit — acceptable.
|
||||
- If MB shape surprises us, variant building degrades to "one variant = canonical" (current behavior).
|
||||
|
||||
## Files touched (anticipated)
|
||||
- `backend/services/musicbrainz_service.py` — variant grouping, locale country pref.
|
||||
- `backend/services/karaokenerds_service.py` — `versions` in batch result.
|
||||
- `backend/api/routes/bulk.py` — models (`BulkEditionVariant`, `CommunityVersion`, `versions`
|
||||
fields), tracklist/availability plumbing, accept `locale`.
|
||||
- `frontend/lib/api.ts` — types for variants + versions.
|
||||
- `frontend/components/job/bulk/types.ts` — `BulkTrack.versions`, variant types.
|
||||
- `frontend/components/job/bulk/BulkAlbumMode.tsx` — C-pattern edition picker, track numbers, pass locale.
|
||||
- `frontend/components/job/bulk/AvailabilityBadge.tsx` — vertical clickable versions list.
|
||||
- `frontend/messages/en.json` (+ 32 locales via translate.py).
|
||||
- Tests alongside each.
|
||||
@@ -0,0 +1,199 @@
|
||||
# PyPI 10 GB Storage-Limit Fix (karaoke-gen)
|
||||
|
||||
**Date:** 2026-06-22
|
||||
**Repo:** `karaoke-gen`
|
||||
**Status:** ✅ Resolved & verified in production
|
||||
**Shipped in:** PR #851 (v0.187.5) + a one-time PyPI release deletion
|
||||
**Related earlier prompt:** `nomadkaraoke/docs/archive/2026-06-18-pypi-storage-limit-fix-prompt.md` (the task spec this session executed; now superseded by this doc)
|
||||
|
||||
---
|
||||
|
||||
## TL;DR
|
||||
|
||||
The PyPI project `karaoke-gen` hit PyPI's **10 GB total-size cap**, so every
|
||||
`poetry publish` on merge to `main` failed with HTTP 400. We fixed it two ways:
|
||||
|
||||
1. **One-time deletion** of 42 old bloated releases (`0.172.1`–`0.182.2`),
|
||||
freeing ~4.35 GB → project down to **~6.36 GB** (3.64 GB headroom).
|
||||
2. **Wheel-only publish** going forward (`poetry build --format wheel`), which
|
||||
halves per-release cost (**104 MB → 54 MB**) by no longer publishing the
|
||||
redundant source distribution.
|
||||
|
||||
Both were needed: deletion unblocks *now*; wheel-only slows *recurrence*.
|
||||
|
||||
---
|
||||
|
||||
## Symptom
|
||||
|
||||
`Deploy - Publish to PyPI` job in `.github/workflows/ci.yml` failed on every
|
||||
push to `main`:
|
||||
|
||||
```
|
||||
HTTP Error 400: Bad Request
|
||||
Project size too large. Limit project 'karaoke-gen' total size 10 GB.
|
||||
See https://docs.pypi.org/project-management/storage-limits
|
||||
```
|
||||
|
||||
The **build** succeeded; only the **upload** was rejected (a project-wide cap,
|
||||
not a per-file or version-conflict error). Backend (Cloud Run), frontend
|
||||
(Cloudflare Pages), and the GCE encoding worker were all unaffected — only the
|
||||
public `pip install karaoke-gen` / `karaoke-gen-remote` path was blocked.
|
||||
|
||||
---
|
||||
|
||||
## Diagnosis (measured, not assumed)
|
||||
|
||||
Pulled the PyPI JSON API and summed file sizes per release:
|
||||
|
||||
- **10.711 GB across 444 releases** (over the 10 GB cap).
|
||||
- Size distribution was bimodal: **387 small releases** (~11 MB median, all
|
||||
`≤0.171.x`) and **57 fat releases** (~104 MB each = 53.7 MB wheel + 50.2 MB
|
||||
sdist) — the fat ones alone were >5.8 GB.
|
||||
- Chronological inflection: the wheel jumped **18 MB → 102 MB on 2026-04-23 at
|
||||
v0.172.1** and stayed fat for every release after.
|
||||
|
||||
### Root cause: the i18n initiative
|
||||
|
||||
The wheel/sdist bundle the Next.js static export
|
||||
(`karaoke_gen/nextjs_frontend/out/**`). When i18n shipped (Apr 2026),
|
||||
`next build` began pre-rendering the **entire app into 33 locale directories**
|
||||
(`hi/`, `th/`, `el/`, `uk/`, `ru/`, `ar/`, `ja/`, …), each ~3.4 MB of HTML.
|
||||
That's ~112 MB uncompressed — a 33× duplication of the page HTML. The shared JS
|
||||
(`out/_next`) is only 4.5 MB; the locale HTML is the bloat. Bundling this in
|
||||
**both** the wheel and the sdist, multiplied across ~57 releases, blew past the cap.
|
||||
|
||||
It was *not* "too many patch versions" — the 387 pre-i18n releases together were
|
||||
under half the total.
|
||||
|
||||
### Why the frontend can't simply be dropped from the wheel
|
||||
|
||||
The **CLI local-review server reads `out/` at runtime**
|
||||
(`karaoke_gen/lyrics_transcriber/review/server.py` → `_mount_frontend` /
|
||||
`_discover_locales`). It serves locale-prefixed routes (`/{locale}/app/jobs/local/review`)
|
||||
because the `LocaleRedirect` client component bounces the browser to
|
||||
`/{locale}/...` by browser preference, and it 404s on any locale not present on
|
||||
disk. So the wheel must keep the full `out/` tree. (The sdist, however, never
|
||||
needs it — see the fix.)
|
||||
|
||||
### Blast radius (why deletion was safe)
|
||||
|
||||
- Nothing in the workspace pins `karaoke-gen==x.y.z` (checked all
|
||||
`*.txt/*.toml/*.cfg/Dockerfile/*.sh`).
|
||||
- The GCE encoding worker pulls the wheel from **GCS**
|
||||
(`gs://karaoke-gen-storage-nomadkaraoke/wheels/karaoke_gen-current.whl`), not PyPI.
|
||||
- Backend/frontend deploys are independent of PyPI.
|
||||
- So PyPI exists only for public `pip install`. Deleting old patch versions has
|
||||
essentially zero internal blast radius.
|
||||
|
||||
---
|
||||
|
||||
## Decisions (Andrew's calls)
|
||||
|
||||
1. **Packaging:** chose wheel-only publish over trying to trim only the frontend
|
||||
out of the sdist (see "Gotcha" below — the trim wasn't a config tweak).
|
||||
2. **Deletion:** approved a **surgical** delete of the *older* fat releases,
|
||||
keeping the 15 most recent fat releases and all small historical ones —
|
||||
rather than a blunt "keep latest N" that would drop old historical versions.
|
||||
|
||||
---
|
||||
|
||||
## What we did
|
||||
|
||||
### Part 1 — Delete 42 old fat releases (irreversible; web UI)
|
||||
|
||||
**Kept:** the 15 most recent fat releases (`0.183.0`–`0.187.2`) + all 387 small
|
||||
releases (`≤0.171.x`).
|
||||
**Deleted:** the 42 fat releases `0.172.1`–`0.182.2`.
|
||||
**Result:** 10.711 GB → ~6.36 GB.
|
||||
|
||||
**How (there is no PyPI deletion API — tokens are upload-only):** drive the
|
||||
logged-in PyPI web UI via browser automation. For each version:
|
||||
|
||||
- Whole-release delete is a POST to
|
||||
`/manage/project/karaoke-gen/release/<version>/` from the modal
|
||||
`#delete_version-modal`, with two fields: a session-wide `csrf_token` (hidden)
|
||||
and `confirm_delete_version` set to the **version string** (not the project name).
|
||||
- We GET each release's manage page, scrape its `csrf_token`, verify the form
|
||||
action matches the exact version, then POST with `credentials: 'include'`,
|
||||
~400 ms apart. A hardcoded keep-list guard ensured the 15 kept versions were
|
||||
never touched. Success = the POST redirects to `/releases/`.
|
||||
|
||||
**Verification gotcha:** the aggregate `pypi.org/pypi/karaoke-gen/json` endpoint
|
||||
is Fastly-cached and lagged for minutes (still showed 444 releases after
|
||||
deletion). Verify instead via the **logged-in manage page** (live: showed
|
||||
exactly 402 releases, all deleted versions absent, all kept versions present) or
|
||||
the **per-version** endpoint `pypi.org/pypi/karaoke-gen/<v>/json` (404s
|
||||
immediately on delete).
|
||||
|
||||
### Part 2 — Wheel-only publish (PR #851, v0.187.5)
|
||||
|
||||
The sdist is dead weight: we ship a universal `py3-none-any` wheel, pip always
|
||||
installs from it, and nothing builds karaoke-gen from source. So we stopped
|
||||
building/publishing the sdist:
|
||||
|
||||
- `poetry build --format wheel` in **both** the `Package - Build & Install (Test)`
|
||||
job and the publish-feeding `Package - Build` job in `.github/workflows/ci.yml`.
|
||||
- Removed `dist/*.tar.gz` from the GitHub release attachments (it no longer exists).
|
||||
- Bumped `0.187.4 → 0.187.5`.
|
||||
|
||||
The wheel is **unchanged** — still bundles the full `out/` the CLI review server
|
||||
needs (verified: built wheel contained all 3575 `out/` entries + the 3 console
|
||||
entry points). Per-release PyPI cost: **104 MB → 54 MB**.
|
||||
|
||||
#### Gotcha: why we did NOT just trim `out/` from the sdist
|
||||
|
||||
The "obvious" fix — keep a small sdist without the frontend — does **not** work
|
||||
with a config tweak, because:
|
||||
|
||||
- `out/` is **git-tracked** under the `karaoke_gen` package, so Poetry pulls it
|
||||
into the sdist as package data.
|
||||
- **Poetry's `exclude` does not remove VCS-tracked files**, even when scoped with
|
||||
`format = "sdist"`. We tried `exclude = [{ path = ".../out/**/*", format = "sdist" }]`
|
||||
and rebuilt — the sdist still contained all 3575 `out/` entries.
|
||||
- `include` takes precedence over `exclude`, so a wheel-scoped `include` for the
|
||||
same path also kept it force-included.
|
||||
|
||||
Trimming the sdist *properly* would have required **untracking `out/` from git**
|
||||
(`git rm --cached`, gitignore it), adding a wheel-only `include`, and adding a
|
||||
frontend build+copy step (`make build-frontend`: `npm run build` →
|
||||
`cp -r frontend/out/* karaoke_gen/nextjs_frontend/out/`) to the `package-build`
|
||||
CI job — which currently has no frontend build and relies on the committed
|
||||
`out/`. That's a bigger, riskier change (CI builds the frontend in the publish
|
||||
path, large git diff, local `poetry build` would need a frontend build first).
|
||||
Wheel-only achieves the same storage win with one-line changes and saves more.
|
||||
|
||||
---
|
||||
|
||||
## Verification (production)
|
||||
|
||||
- `Deploy - Publish to PyPI` job **succeeded** on the post-merge run (no 400).
|
||||
- **0.187.5 is live on PyPI as wheel-only** — one file: the 53.7 MB
|
||||
`karaoke_gen-0.187.5-py3-none-any.whl`, no `.tar.gz`.
|
||||
- Project size ~6.36 GB (3.64 GB headroom).
|
||||
- Encoding worker VM was auto-stopped (idle, normal cost-saving). It is
|
||||
unaffected — the wheel content and the GCS wheel-upload step are unchanged; it
|
||||
pulls `karaoke_gen-current.whl` from GCS as usual on its next boot.
|
||||
|
||||
---
|
||||
|
||||
## If this recurs (runbook)
|
||||
|
||||
**Headroom math:** at 54 MB/release with ~3.64 GB headroom, that's ~65 more
|
||||
releases before the cap bites again — months at current cadence.
|
||||
|
||||
When the publish starts 400ing again:
|
||||
|
||||
1. **Measure:** sum per-release sizes from `pypi.org/pypi/karaoke-gen/json`
|
||||
(use a file + `python3`, not piped curl — output filters can mangle it).
|
||||
Identify the fat band and a safe keep-set (latest N + anything still referenced).
|
||||
2. **Delete surgically** via the browser web-UI technique in Part 1 (no API).
|
||||
Verify via the logged-in manage page / per-version JSON, NOT the cached
|
||||
aggregate JSON.
|
||||
3. **Confirm** the wheel itself hasn't re-bloated. If the frontend grew, the next
|
||||
lever (more involved) is to stop committing `out/` and host/download it instead
|
||||
of bundling — see the "Gotcha" above for the shape of that change.
|
||||
4. PyPI also accepts storage-limit-increase requests (free, slow, days–weeks) as
|
||||
a fallback if deletion isn't enough.
|
||||
|
||||
**Do not** rely on `exclude` to slim the sdist while `out/` is git-tracked — it
|
||||
won't work.
|
||||
@@ -0,0 +1,80 @@
|
||||
# Apple Music URL → cascading download-failure alerts (2026-06-27)
|
||||
|
||||
## Incident
|
||||
|
||||
Four "New Error Pattern" alerts fired simultaneously (first seen `2026-06-27T20:32:01Z`):
|
||||
|
||||
1. `karaoke-backend` — `URL download failed: ... Unsupported URL: https://music.apple.com/...` (×2)
|
||||
2. `karaoke-backend` — `Job <ID> failed: Download failed: ... Unsupported URL: https://music.apple.com/...` (×2)
|
||||
3. `audio-separation-job` — `Exception: Failed to download audio file` (×6)
|
||||
4. `lyrics-transcription-job` — `Exception: Failed to download audio file` (×6)
|
||||
|
||||
All four were **one incident**: a single user tried to make a karaoke track from an
|
||||
Apple Music link (Hailey Whitters – "Gone Country"), submitted it twice (jobs
|
||||
`7f36304a` + `cb145971`), and clicked **Retry** once.
|
||||
|
||||
### Confirmed timeline (job `7f36304a`)
|
||||
|
||||
| Time (UTC) | Event |
|
||||
|---|---|
|
||||
| 20:23:02 | Job created from `https://music.apple.com/...` |
|
||||
| 20:23:07 | flacfetch → `Unsupported URL` → job **failed**, HTTP 500 to user |
|
||||
| 20:23:20 | User resubmits same URL → job `cb145971`, fails identically |
|
||||
| 20:23:31 | User clicks **Retry** → `POST /api/jobs/7f36304a/retry` → *"Has input audio, restarting from beginning"* |
|
||||
| 20:23:32 | Retry triggers **audio-separation-job + lyrics-transcription-job** (NOT a re-download) |
|
||||
| 20:24–20:28 | Workers find no audio in GCS → "Failed to download audio file" → Cloud Run retries each task several times → the ×6/×6 counts |
|
||||
|
||||
## Root causes (two bugs)
|
||||
|
||||
### Bug A — DRM streaming URLs accepted, then fail deep with a cryptic error
|
||||
`_validate_url` (`backend/api/routes/file_upload.py`) has a supported-domain allowlist
|
||||
but falls through to `return True` for everything else ("let yt-dlp try"). Apple Music
|
||||
/ Spotify / Tidal / Amazon Music / Deezer / Pandora are DRM-protected and can *never* be
|
||||
downloaded, so a job got created and died at the download stage with an HTTP 500 +
|
||||
"Unsupported URL".
|
||||
|
||||
### Bug B — retrying a URL job that failed *before download* fires the wrong workers
|
||||
`backend/api/routes/jobs.py` retry path used
|
||||
`elif job.input_media_gcs_path or job.url:` to "restart from beginning". A URL job whose
|
||||
download never succeeded still has `job.url` set (but **no** audio in GCS), so Retry
|
||||
jumped straight to the audio/lyrics workers. They can't find audio → "Failed to download
|
||||
audio file" → Cloud Run retries them → wasted GPU + noisy alerts. Latent for *any*
|
||||
URL-download failure (private/geo YouTube, transient flacfetch errors), not just Apple Music.
|
||||
|
||||
## Fixes
|
||||
|
||||
- **Bug A:** new `_unsupported_url_platform(url)` helper + a known-DRM-host map; the
|
||||
`create-from-url` endpoint now returns **400** with a friendly i18n message
|
||||
(`audioSearch.drmUrlUnsupported`, translated to all 33 locales) before a job is created.
|
||||
YouTube Music (`music.youtube.com`) is deliberately *not* blocked (it's downloadable).
|
||||
- The message suggests downloading the audio with a third-party tool and then
|
||||
uploading the file. For platforms with a verified downloader
|
||||
(`_DRM_DOWNLOADER_SUGGESTIONS`) it links to it — Apple Music →
|
||||
`https://am-dl.pages.dev` — via the `drmUrlUnsupportedWithLink` variant.
|
||||
- URLs in submit-error messages are now clickable via a new
|
||||
`LinkifiedText` component (`frontend/components/ui/linkified-text.tsx`), wired
|
||||
into the guided flow and the URL-tab submit error.
|
||||
- **Bug B:** the retry "restart from beginning" branch is now gated on
|
||||
`job.input_media_gcs_path` only. URL jobs without downloaded audio fall through to the
|
||||
existing clean **"resubmit"** 400 instead of firing doomed workers — matching the
|
||||
endpoint's documented intent ("re-runs from beginning if input audio exists").
|
||||
|
||||
## Tests
|
||||
|
||||
- `TestUnsupportedDrmUrl` (`test_file_upload.py`) — detection across Apple Music / Spotify
|
||||
/ Tidal / Amazon Music / Deezer / Pandora (+ subdomains); YouTube/YouTube Music/Vimeo/
|
||||
SoundCloud/generic/None not flagged.
|
||||
- `TestRetryUrlJobWithoutDownload` (`test_routes_jobs.py`) — URL job without audio → 400
|
||||
resubmit + **no** workers scheduled; URL job *with* audio in GCS → restarts + workers
|
||||
scheduled.
|
||||
|
||||
## Not done (deliberately out of scope)
|
||||
|
||||
- **Re-download on retry for URL jobs.** There is no worker that re-downloads a *generic*
|
||||
`job.url` (the download is inline in `create-from-url`; `audio_download_worker` only
|
||||
handles audio-search sources: YouTube/RED/OPS/Spotify-by-id). For transient URL failures
|
||||
the user must resubmit. A future enhancement could extract the inline download into a
|
||||
reusable worker so Retry can re-fetch.
|
||||
- **Worker-side hard exit.** `audio_worker.py` detects the bad state but logs
|
||||
"Continue anyway"; fixing the retry trigger (Bug B) removes the amplification at its
|
||||
source, so the worker guard was left as-is to contain risk.
|
||||
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @jest-environment jsdom
|
||||
*
|
||||
* Tests for CommunityVersions — the vertical, clickable list of existing
|
||||
* community karaoke versions shown under a bulk-mode track. next-intl is
|
||||
* globally mocked in jest.setup.js (real 'bulk' strings).
|
||||
*/
|
||||
|
||||
import React from 'react'
|
||||
import { render, screen } from '@testing-library/react'
|
||||
import { CommunityVersions } from '@/components/job/bulk/CommunityVersions'
|
||||
|
||||
describe('CommunityVersions', () => {
|
||||
const versions = [
|
||||
{ brand: 'SNDL Karaoke', url: 'https://www.youtube.com/watch?v=aaa' },
|
||||
{ brand: 'Nomad Karaoke', url: 'https://www.youtube.com/watch?v=bbb' },
|
||||
]
|
||||
|
||||
it('renders a clickable YouTube link per version, opening in a new tab', () => {
|
||||
render(<CommunityVersions available versions={versions} />)
|
||||
expect(screen.getByText(/existing versions/i)).toBeInTheDocument()
|
||||
|
||||
const sndl = screen.getByRole('link', { name: /SNDL Karaoke/ })
|
||||
expect(sndl).toHaveAttribute('href', 'https://www.youtube.com/watch?v=aaa')
|
||||
expect(sndl).toHaveAttribute('target', '_blank')
|
||||
expect(sndl).toHaveAttribute('rel', 'noopener noreferrer')
|
||||
|
||||
const nomad = screen.getByRole('link', { name: /Nomad Karaoke/ })
|
||||
expect(nomad).toHaveAttribute('href', 'https://www.youtube.com/watch?v=bbb')
|
||||
|
||||
expect(screen.getAllByRole('link')).toHaveLength(2)
|
||||
})
|
||||
|
||||
it('shows a plain "exists" line when available but no versions have URLs', () => {
|
||||
render(<CommunityVersions available versions={[]} />)
|
||||
expect(screen.getByText(/community version exists/i)).toBeInTheDocument()
|
||||
expect(screen.queryAllByRole('link')).toHaveLength(0)
|
||||
})
|
||||
|
||||
it('renders nothing when the track is not already available', () => {
|
||||
const { container } = render(<CommunityVersions available={false} versions={versions} />)
|
||||
expect(container.firstChild).toBeNull()
|
||||
})
|
||||
})
|
||||
@@ -7,6 +7,7 @@ import { useTenant } from "@/lib/tenant"
|
||||
import { api, ApiError } from "@/lib/api"
|
||||
import { AlertTriangle, CheckCircle2, Music } from "lucide-react"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { LinkifiedText } from "@/components/ui/linkified-text"
|
||||
import { BuyCreditsDialog } from "@/components/credits/BuyCreditsDialog"
|
||||
import { SongInfoStep } from "./steps/SongInfoStep"
|
||||
import { AudioSourceStep } from "./steps/AudioSourceStep"
|
||||
@@ -490,7 +491,7 @@ export function GuidedJobFlow({ onJobCreated }: GuidedJobFlowProps) {
|
||||
{/* Submit error */}
|
||||
{submitError && (
|
||||
<div className="text-sm text-red-400 bg-red-500/10 rounded p-3">
|
||||
<p>{submitError}</p>
|
||||
<p><LinkifiedText text={submitError} /></p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import type { CatalogArtistResult, CatalogTrackResult, CommunityCheckResponse }
|
||||
import { useAuth } from "@/lib/auth"
|
||||
import { useTenant } from "@/lib/tenant"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { LinkifiedText } from "@/components/ui/linkified-text"
|
||||
import { Input } from "@/components/ui/input"
|
||||
import { AutocompleteInput, type AutocompleteSuggestion } from "@/components/ui/autocomplete-input"
|
||||
import { CommunityVersionBanner } from "@/components/job/CommunityVersionBanner"
|
||||
@@ -538,7 +539,7 @@ export function JobSubmission({ onJobCreated }: JobSubmissionProps) {
|
||||
|
||||
{error && activeTab === "url" && (
|
||||
<div className="text-sm text-red-400 bg-red-500/10 rounded p-2">
|
||||
<p>{error}</p>
|
||||
<p><LinkifiedText text={error} /></p>
|
||||
{isCreditError && (
|
||||
<button onClick={() => setShowBuyCreditsDialog(true)} className="inline-block mt-1 font-medium underline" style={{ color: 'var(--brand-pink)' }}>Buy Credits</button>
|
||||
)}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
"use client"
|
||||
|
||||
import { useTranslations } from "next-intl"
|
||||
import { Badge } from "@/components/ui/badge"
|
||||
import { Check } from "lucide-react"
|
||||
|
||||
interface AvailabilityBadgeProps {
|
||||
available?: boolean | null
|
||||
brands?: string[]
|
||||
}
|
||||
|
||||
/** Shows "community version exists" when a track is already on KaraokeNerds. */
|
||||
export function AvailabilityBadge({ available, brands }: AvailabilityBadgeProps) {
|
||||
const t = useTranslations("bulk")
|
||||
if (!available) return null
|
||||
const brandList = (brands || []).slice(0, 3).join(", ")
|
||||
return (
|
||||
<Badge variant="outline" className="text-amber-500 border-amber-500/40 gap-1">
|
||||
<Check className="w-3 h-3" />
|
||||
{brandList ? t("communityExistsWithBrands", { brands: brandList }) : t("communityExists")}
|
||||
</Badge>
|
||||
)
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
"use client"
|
||||
|
||||
import { useState } from "react"
|
||||
import { useTranslations } from "next-intl"
|
||||
import { api, BulkArtist, BulkAlbum, BulkTracklist } from "@/lib/api"
|
||||
import { useTranslations, useLocale } from "next-intl"
|
||||
import { api, BulkArtist, BulkAlbum, BulkTracklist, BulkEditionVariant } from "@/lib/api"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Input } from "@/components/ui/input"
|
||||
import { Checkbox } from "@/components/ui/checkbox"
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
Select, SelectContent, SelectItem, SelectTrigger, SelectValue,
|
||||
} from "@/components/ui/select"
|
||||
import { Loader2, Search, ChevronLeft } from "lucide-react"
|
||||
import { AvailabilityBadge } from "./AvailabilityBadge"
|
||||
import { CommunityVersions } from "./CommunityVersions"
|
||||
import { BulkSongRow, newRow, shouldSelectTrack } from "./types"
|
||||
|
||||
interface BulkAlbumModeProps {
|
||||
@@ -28,17 +28,24 @@ function fmtLen(ms?: number | null): string {
|
||||
|
||||
export function BulkAlbumMode({ rows, onChange, disabled }: BulkAlbumModeProps) {
|
||||
const t = useTranslations("bulk")
|
||||
const locale = useLocale()
|
||||
const [query, setQuery] = useState("")
|
||||
const [artists, setArtists] = useState<BulkArtist[]>([])
|
||||
const [artist, setArtist] = useState<BulkArtist | null>(null)
|
||||
const [albums, setAlbums] = useState<BulkAlbum[]>([])
|
||||
const [tracklist, setTracklist] = useState<BulkTracklist | null>(null)
|
||||
// Distinct tracklist variants for the loaded album. Held separately from
|
||||
// `tracklist` because switching to a specific edition returns no variant list.
|
||||
const [variants, setVariants] = useState<BulkEditionVariant[]>([])
|
||||
const [showVariants, setShowVariants] = useState(false)
|
||||
const [loading, setLoading] = useState<"" | "artists" | "albums" | "tracks">("")
|
||||
const [error, setError] = useState("")
|
||||
|
||||
function resetVariants() { setVariants([]); setShowVariants(false) }
|
||||
|
||||
async function searchArtists() {
|
||||
if (query.trim().length < 2) return
|
||||
setLoading("artists"); setError(""); setArtists([]); setArtist(null); setAlbums([]); setTracklist(null)
|
||||
setLoading("artists"); setError(""); setArtists([]); setArtist(null); setAlbums([]); setTracklist(null); resetVariants()
|
||||
try {
|
||||
setArtists(await api.searchAlbumArtists(query.trim()))
|
||||
} catch {
|
||||
@@ -50,7 +57,7 @@ export function BulkAlbumMode({ rows, onChange, disabled }: BulkAlbumModeProps)
|
||||
|
||||
async function pickArtist(a: BulkArtist) {
|
||||
if (!a.mbid) return
|
||||
setArtist(a); setLoading("albums"); setError(""); setAlbums([]); setTracklist(null)
|
||||
setArtist(a); setLoading("albums"); setError(""); setAlbums([]); setTracklist(null); resetVariants()
|
||||
try {
|
||||
setAlbums(await api.getAlbums(a.mbid))
|
||||
} catch {
|
||||
@@ -69,20 +76,23 @@ export function BulkAlbumMode({ rows, onChange, disabled }: BulkAlbumModeProps)
|
||||
selected: shouldSelectTrack(tr),
|
||||
available: tr.available,
|
||||
brands: tr.brands,
|
||||
versions: tr.versions,
|
||||
is_extra: tr.is_extra,
|
||||
length_ms: tr.length_ms,
|
||||
position: tr.position,
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
async function pickAlbum(album: BulkAlbum) {
|
||||
if (!artist?.name) return
|
||||
setLoading("tracks"); setError("")
|
||||
setLoading("tracks"); setError(""); resetVariants()
|
||||
try {
|
||||
const tl = await api.getAlbumTracklist({
|
||||
artist: artist.name, releaseGroupMbid: album.release_group_mbid,
|
||||
artist: artist.name, releaseGroupMbid: album.release_group_mbid, locale,
|
||||
})
|
||||
setTracklist(tl)
|
||||
setVariants(tl.variants || [])
|
||||
onChange(buildRows(tl))
|
||||
} catch {
|
||||
setError(t("lookupFailed"))
|
||||
@@ -93,9 +103,10 @@ export function BulkAlbumMode({ rows, onChange, disabled }: BulkAlbumModeProps)
|
||||
|
||||
async function switchEdition(releaseMbid: string) {
|
||||
if (!artist?.name) return
|
||||
setLoading("tracks"); setError("")
|
||||
setLoading("tracks"); setError(""); setShowVariants(false)
|
||||
try {
|
||||
const tl = await api.getAlbumTracklist({ artist: artist.name, releaseMbid })
|
||||
// Loading a specific variant returns no variant list — keep the existing one.
|
||||
const tl = await api.getAlbumTracklist({ artist: artist.name, releaseMbid, locale })
|
||||
setTracklist(tl)
|
||||
onChange(buildRows(tl))
|
||||
} catch {
|
||||
@@ -105,31 +116,70 @@ export function BulkAlbumMode({ rows, onChange, disabled }: BulkAlbumModeProps)
|
||||
}
|
||||
}
|
||||
|
||||
// Translate the backend's English variant label; compose the "+N bonus" suffix.
|
||||
const variantLabel = (label: string) =>
|
||||
label === "Original" ? t("variantOriginal") : t("variantReissue")
|
||||
const variantBonus = (delta: number) => (delta > 0 ? ` (${t("variantBonus", { count: delta })})` : "")
|
||||
const variantText = (v: BulkEditionVariant) =>
|
||||
`${variantLabel(v.label)} · ${v.year || "?"} · ${t("trackCount", { count: v.track_count })}${variantBonus(v.delta_vs_original)}`
|
||||
|
||||
const toggle = (key: string, checked: boolean) =>
|
||||
onChange(rows.map((r) => (r.key === key ? { ...r, selected: checked } : r)))
|
||||
|
||||
// --- Render: tracklist view ---
|
||||
if (tracklist && artist) {
|
||||
const editionValue = tracklist.release_mbid || tracklist.canonical_release_mbid || ""
|
||||
const currentMbid = tracklist.selected_variant_mbid || tracklist.release_mbid
|
||||
|| tracklist.canonical_release_mbid || ""
|
||||
const selectedVariant = variants.find((v) => v.representative_release_mbid === currentMbid)
|
||||
return (
|
||||
<div className="space-y-3">
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<Button variant="ghost" size="sm" onClick={() => setTracklist(null)} disabled={disabled}>
|
||||
<div className="flex items-center justify-between gap-2 flex-wrap">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => { setTracklist(null); resetVariants() }}
|
||||
disabled={disabled}
|
||||
>
|
||||
<ChevronLeft className="w-4 h-4 me-1" />{t("backToAlbums")}
|
||||
</Button>
|
||||
{tracklist.editions.length > 1 && (
|
||||
<Select value={editionValue} onValueChange={switchEdition} disabled={disabled}>
|
||||
<SelectTrigger className="h-8 w-[200px] text-xs">
|
||||
<SelectValue placeholder={t("edition")} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{tracklist.editions.map((e) => (
|
||||
<SelectItem key={e.release_mbid} value={e.release_mbid}>
|
||||
{(e.date || "?")} · {e.country || "—"} · {t("trackCount", { count: e.track_count })}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
{/* Single confident default; full variant list only on "Change". */}
|
||||
{variants.length > 0 && selectedVariant && (
|
||||
showVariants && variants.length > 1 ? (
|
||||
<Select value={currentMbid} onValueChange={switchEdition} disabled={disabled}>
|
||||
<SelectTrigger className="h-8 w-[260px] text-xs">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{variants.map((v) => (
|
||||
<SelectItem key={v.representative_release_mbid} value={v.representative_release_mbid}>
|
||||
{variantText(v)}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
) : (
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-xs" style={{ color: "var(--text-muted)" }}>
|
||||
{t("usingRelease", {
|
||||
label: variantLabel(selectedVariant.label),
|
||||
year: selectedVariant.year || "?",
|
||||
tracks: t("trackCount", { count: selectedVariant.track_count }),
|
||||
})}
|
||||
{variantBonus(selectedVariant.delta_vs_original)}
|
||||
</span>
|
||||
{variants.length > 1 && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="h-7 text-xs"
|
||||
onClick={() => setShowVariants(true)}
|
||||
disabled={disabled}
|
||||
>
|
||||
{t("changeEdition")}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -140,26 +190,34 @@ export function BulkAlbumMode({ rows, onChange, disabled }: BulkAlbumModeProps)
|
||||
|
||||
<div className="space-y-1 max-h-[420px] overflow-y-auto pe-1">
|
||||
{rows.map((row) => (
|
||||
<label
|
||||
key={row.key}
|
||||
className="flex items-center gap-2 rounded-md px-2 py-1.5 cursor-pointer hover:bg-white/5"
|
||||
>
|
||||
<Checkbox
|
||||
checked={row.selected}
|
||||
onCheckedChange={(v) => toggle(row.key, v === true)}
|
||||
disabled={disabled}
|
||||
/>
|
||||
<span className="flex-1 min-w-0 text-sm truncate" style={{ color: "var(--text)" }}>
|
||||
{row.title}
|
||||
</span>
|
||||
{row.is_extra && (
|
||||
<Badge variant="outline" className="text-pink-400 border-pink-400/40">{t("extra")}</Badge>
|
||||
)}
|
||||
<AvailabilityBadge available={row.available} brands={row.brands} />
|
||||
<span className="text-xs w-10 text-end shrink-0" style={{ color: "var(--text-muted)" }}>
|
||||
{fmtLen(row.length_ms)}
|
||||
</span>
|
||||
</label>
|
||||
<div key={row.key} className="rounded-md px-2 py-1.5 hover:bg-white/5">
|
||||
<label className="flex items-center gap-2 cursor-pointer">
|
||||
<Checkbox
|
||||
checked={row.selected}
|
||||
onCheckedChange={(v) => toggle(row.key, v === true)}
|
||||
disabled={disabled}
|
||||
/>
|
||||
{row.position != null && (
|
||||
<span
|
||||
className="text-xs w-5 text-end shrink-0 tabular-nums"
|
||||
style={{ color: "var(--text-muted)" }}
|
||||
>
|
||||
{row.position}
|
||||
</span>
|
||||
)}
|
||||
<span className="flex-1 min-w-0 text-sm truncate" style={{ color: "var(--text)" }}>
|
||||
{row.title}
|
||||
</span>
|
||||
{row.is_extra && (
|
||||
<Badge variant="outline" className="text-pink-400 border-pink-400/40">{t("extra")}</Badge>
|
||||
)}
|
||||
<span className="text-xs w-10 text-end shrink-0" style={{ color: "var(--text-muted)" }}>
|
||||
{fmtLen(row.length_ms)}
|
||||
</span>
|
||||
</label>
|
||||
{/* Outside the <label> so clicking a version link never toggles the checkbox. */}
|
||||
<CommunityVersions available={row.available} versions={row.versions} />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,7 +6,7 @@ import { api } from "@/lib/api"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Input } from "@/components/ui/input"
|
||||
import { Plus, X } from "lucide-react"
|
||||
import { AvailabilityBadge } from "./AvailabilityBadge"
|
||||
import { CommunityVersions } from "./CommunityVersions"
|
||||
import { BulkSongRow, newRow } from "./types"
|
||||
|
||||
interface BulkTextModeProps {
|
||||
@@ -57,7 +57,7 @@ export function BulkTextMode({ rows, onChange, maxSongs, disabled }: BulkTextMod
|
||||
onChange(
|
||||
rows.map((r) => {
|
||||
const hit = byKey.get(`${r.artist.trim()}|||${r.title.trim()}`)
|
||||
return hit ? { ...r, available: hit.available, brands: hit.brands } : r
|
||||
return hit ? { ...r, available: hit.available, brands: hit.brands, versions: hit.versions } : r
|
||||
})
|
||||
)
|
||||
} catch {
|
||||
@@ -76,31 +76,31 @@ export function BulkTextMode({ rows, onChange, maxSongs, disabled }: BulkTextMod
|
||||
<div className="space-y-2">
|
||||
<p className="text-xs" style={{ color: "var(--text-muted)" }}>{t("textModeHint", { max: maxSongs })}</p>
|
||||
{rows.map((row) => (
|
||||
<div key={row.key} className="flex items-center gap-2">
|
||||
<Input
|
||||
placeholder={t("artist")}
|
||||
value={row.artist}
|
||||
disabled={disabled}
|
||||
onChange={(e) => update(row.key, { artist: e.target.value, available: null })}
|
||||
className="flex-1"
|
||||
/>
|
||||
<Input
|
||||
placeholder={t("title")}
|
||||
value={row.title}
|
||||
disabled={disabled}
|
||||
onChange={(e) => update(row.key, { title: e.target.value, available: null })}
|
||||
className="flex-1"
|
||||
/>
|
||||
<div className="w-40 shrink-0">
|
||||
<AvailabilityBadge available={row.available} brands={row.brands} />
|
||||
<div key={row.key}>
|
||||
<div className="flex items-center gap-2">
|
||||
<Input
|
||||
placeholder={t("artist")}
|
||||
value={row.artist}
|
||||
disabled={disabled}
|
||||
onChange={(e) => update(row.key, { artist: e.target.value, available: null })}
|
||||
className="flex-1"
|
||||
/>
|
||||
<Input
|
||||
placeholder={t("title")}
|
||||
value={row.title}
|
||||
disabled={disabled}
|
||||
onChange={(e) => update(row.key, { title: e.target.value, available: null })}
|
||||
className="flex-1"
|
||||
/>
|
||||
<Button
|
||||
variant="ghost" size="sm" disabled={disabled}
|
||||
onClick={() => removeRow(row.key)}
|
||||
aria-label={t("removeRow")}
|
||||
>
|
||||
<X className="w-4 h-4" />
|
||||
</Button>
|
||||
</div>
|
||||
<Button
|
||||
variant="ghost" size="sm" disabled={disabled}
|
||||
onClick={() => removeRow(row.key)}
|
||||
aria-label={t("removeRow")}
|
||||
>
|
||||
<X className="w-4 h-4" />
|
||||
</Button>
|
||||
<CommunityVersions available={row.available} versions={row.versions} />
|
||||
</div>
|
||||
))}
|
||||
<div className="flex items-center justify-between">
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
"use client"
|
||||
|
||||
import { useTranslations } from "next-intl"
|
||||
import { Youtube } from "lucide-react"
|
||||
import type { CommunityVersion } from "@/lib/api"
|
||||
|
||||
interface CommunityVersionsProps {
|
||||
available?: boolean | null
|
||||
versions?: CommunityVersion[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Existing community karaoke versions for a track, shown as a vertical list of
|
||||
* clickable YouTube links so the user can preview each and decide whether to
|
||||
* remake it with our generator. Falls back to a plain "exists" line when we know
|
||||
* a version exists but have no playable URL. Renders nothing if the track isn't
|
||||
* already available.
|
||||
*/
|
||||
export function CommunityVersions({ available, versions }: CommunityVersionsProps) {
|
||||
const t = useTranslations("bulk")
|
||||
if (!available) return null
|
||||
const list = versions || []
|
||||
|
||||
if (list.length === 0) {
|
||||
return <p className="text-xs text-amber-500/90 ps-7">{t("communityExists")}</p>
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="ps-7 mt-0.5 space-y-0.5">
|
||||
<p className="text-xs" style={{ color: "var(--text-muted)" }}>{t("existingVersions")}</p>
|
||||
<ul className="space-y-0.5">
|
||||
{list.map((v) => {
|
||||
// Only ever render http(s) hrefs — never an attacker-controlled scheme.
|
||||
const safe = /^https?:\/\//i.test(v.url)
|
||||
return (
|
||||
<li key={`${v.brand}-${v.url}`}>
|
||||
{safe ? (
|
||||
<a
|
||||
href={v.url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1.5 text-xs text-amber-500 hover:underline"
|
||||
>
|
||||
<Youtube className="w-3.5 h-3.5 shrink-0" />
|
||||
<span>{v.brand}</span>
|
||||
</a>
|
||||
) : (
|
||||
<span className="inline-flex items-center gap-1.5 text-xs text-amber-500/80">
|
||||
<Youtube className="w-3.5 h-3.5 shrink-0" />
|
||||
<span>{v.brand}</span>
|
||||
</span>
|
||||
)}
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { CommunityVersion } from "@/lib/api"
|
||||
|
||||
export interface BulkSongRow {
|
||||
key: string
|
||||
artist: string
|
||||
@@ -7,8 +9,10 @@ export interface BulkSongRow {
|
||||
selected: boolean
|
||||
available?: boolean | null
|
||||
brands?: string[]
|
||||
versions?: CommunityVersion[]
|
||||
is_extra?: boolean
|
||||
length_ms?: number | null
|
||||
position?: number | null
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
import { render, screen } from "@testing-library/react"
|
||||
import { LinkifiedText } from "../linkified-text"
|
||||
|
||||
describe("LinkifiedText", () => {
|
||||
it("renders a URL inside a message as a clickable link", () => {
|
||||
render(
|
||||
<LinkifiedText text="Download from https://am-dl.pages.dev, then upload the file." />
|
||||
)
|
||||
const link = screen.getByRole("link", { name: "https://am-dl.pages.dev" })
|
||||
expect(link).toHaveAttribute("href", "https://am-dl.pages.dev")
|
||||
expect(link).toHaveAttribute("target", "_blank")
|
||||
expect(link).toHaveAttribute("rel", "noopener noreferrer")
|
||||
})
|
||||
|
||||
it("keeps surrounding text and trailing punctuation as plain text", () => {
|
||||
const { container } = render(
|
||||
<LinkifiedText text="See https://example.com. Thanks!" />
|
||||
)
|
||||
// The trailing period must not be part of the href.
|
||||
const link = screen.getByRole("link")
|
||||
expect(link).toHaveAttribute("href", "https://example.com")
|
||||
expect(container.textContent).toBe("See https://example.com. Thanks!")
|
||||
})
|
||||
|
||||
it("keeps brackets that are part of the URL path", () => {
|
||||
render(
|
||||
<LinkifiedText text="See https://en.wikipedia.org/wiki/Foo_(bar) here." />
|
||||
)
|
||||
const link = screen.getByRole("link")
|
||||
expect(link).toHaveAttribute(
|
||||
"href",
|
||||
"https://en.wikipedia.org/wiki/Foo_(bar)"
|
||||
)
|
||||
})
|
||||
|
||||
it("renders plain text unchanged when there is no URL", () => {
|
||||
render(<LinkifiedText text="Apple Music links can't be downloaded." />)
|
||||
expect(screen.queryByRole("link")).toBeNull()
|
||||
expect(
|
||||
screen.getByText("Apple Music links can't be downloaded.")
|
||||
).toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,37 @@
|
||||
import React from "react"
|
||||
|
||||
// Capturing split so http(s) URLs are preserved as their own array entries.
|
||||
// The final character class trims trailing sentence punctuation (so
|
||||
// "see https://x.com." links "https://x.com" and leaves the period as text) but
|
||||
// deliberately keeps brackets, which are often part of the path (e.g. a
|
||||
// Wikipedia URL ending in "_(disambiguation)").
|
||||
const URL_SPLIT_RE = /(https?:\/\/[^\s]+[^\s.,;:!?])/g
|
||||
|
||||
/**
|
||||
* Render a plain string with any http(s) URLs turned into clickable links.
|
||||
* Used for backend-provided messages (e.g. error details) that may suggest a
|
||||
* URL the user should open, since those messages are otherwise shown verbatim.
|
||||
*/
|
||||
export function LinkifiedText({ text, className }: { text: string; className?: string }) {
|
||||
const parts = text.split(URL_SPLIT_RE)
|
||||
return (
|
||||
<span className={className}>
|
||||
{parts.map((part, i) => {
|
||||
if (part.startsWith("http://") || part.startsWith("https://")) {
|
||||
return (
|
||||
<a
|
||||
key={i}
|
||||
href={part}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="underline break-all hover:text-red-300"
|
||||
>
|
||||
{part}
|
||||
</a>
|
||||
)
|
||||
}
|
||||
return <React.Fragment key={i}>{part}</React.Fragment>
|
||||
})}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
@@ -477,6 +477,22 @@ export interface BulkEdition {
|
||||
track_count: number;
|
||||
}
|
||||
|
||||
/** An existing community karaoke version the user can preview on YouTube. */
|
||||
export interface CommunityVersion {
|
||||
brand: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
/** A distinct tracklist variant (country pressings collapsed by track count). */
|
||||
export interface BulkEditionVariant {
|
||||
representative_release_mbid: string;
|
||||
label: string; // "Original" | "Reissue"
|
||||
track_count: number;
|
||||
year: string;
|
||||
pressing_count: number;
|
||||
delta_vs_original: number;
|
||||
}
|
||||
|
||||
export interface BulkTrack {
|
||||
position: number | null;
|
||||
title: string;
|
||||
@@ -486,15 +502,18 @@ export interface BulkTrack {
|
||||
extra_reason: string;
|
||||
available: boolean;
|
||||
brands: string[];
|
||||
versions: CommunityVersion[];
|
||||
}
|
||||
|
||||
export interface BulkTracklist {
|
||||
release_mbid: string | null;
|
||||
canonical_release_mbid: string | null;
|
||||
selected_variant_mbid: string | null;
|
||||
title: string | null;
|
||||
date: string;
|
||||
tracks: BulkTrack[];
|
||||
editions: BulkEdition[];
|
||||
variants: BulkEditionVariant[];
|
||||
}
|
||||
|
||||
export interface BulkAvailabilityResult {
|
||||
@@ -503,6 +522,7 @@ export interface BulkAvailabilityResult {
|
||||
available: boolean;
|
||||
brands: string[];
|
||||
brand_count: number;
|
||||
versions: CommunityVersion[];
|
||||
}
|
||||
|
||||
export interface BulkSettings {
|
||||
@@ -1283,10 +1303,12 @@ export const api = {
|
||||
artist: string;
|
||||
releaseGroupMbid?: string;
|
||||
releaseMbid?: string;
|
||||
locale?: string;
|
||||
}): Promise<BulkTracklist> {
|
||||
const qs = new URLSearchParams({ artist: params.artist });
|
||||
if (params.releaseGroupMbid) qs.set('release_group_mbid', params.releaseGroupMbid);
|
||||
if (params.releaseMbid) qs.set('release_mbid', params.releaseMbid);
|
||||
if (params.locale) qs.set('locale', params.locale);
|
||||
const response = await fetch(`${API_BASE_URL}/api/bulk/album/tracklist?${qs.toString()}`, {
|
||||
headers: { ...getAuthHeaders() },
|
||||
});
|
||||
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "فنان",
|
||||
"buyCredits": "شراء رصيد",
|
||||
"removeRow": "إزالة",
|
||||
"trackCount": "{count} مقاطع"
|
||||
"trackCount": "{count} مقاطع",
|
||||
"changeEdition": "تغيير",
|
||||
"existingVersions": "الإصدارات الحالية:",
|
||||
"usingRelease": "استخدام {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} إضافي",
|
||||
"variantOriginal": "أصلي",
|
||||
"variantReissue": "إعادة إصدار"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Artista",
|
||||
"buyCredits": "Compra crèdits",
|
||||
"removeRow": "Elimina",
|
||||
"trackCount": "{count} pistes"
|
||||
"trackCount": "{count} pistes",
|
||||
"changeEdition": "Canvia",
|
||||
"existingVersions": "Versions existents:",
|
||||
"usingRelease": "Utilitzant {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} bonus",
|
||||
"variantOriginal": "Original",
|
||||
"variantReissue": "Reedició"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Umělec",
|
||||
"buyCredits": "Koupit kredity",
|
||||
"removeRow": "Odstranit",
|
||||
"trackCount": "{count} skladeb"
|
||||
"trackCount": "{count} skladeb",
|
||||
"changeEdition": "Změnit",
|
||||
"existingVersions": "Existující verze:",
|
||||
"usingRelease": "Používá se {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} bonus",
|
||||
"variantOriginal": "Originál",
|
||||
"variantReissue": "Reedice"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Kunstner",
|
||||
"buyCredits": "Køb kreditter",
|
||||
"removeRow": "Fjern",
|
||||
"trackCount": "{count} numre"
|
||||
"trackCount": "{count} numre",
|
||||
"changeEdition": "Skift",
|
||||
"existingVersions": "Eksisterende versioner:",
|
||||
"usingRelease": "Bruger {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} bonus",
|
||||
"variantOriginal": "Original",
|
||||
"variantReissue": "Genudgivelse"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Künstler",
|
||||
"buyCredits": "Guthaben kaufen",
|
||||
"removeRow": "Entfernen",
|
||||
"trackCount": "{count} Tracks"
|
||||
"trackCount": "{count} Tracks",
|
||||
"changeEdition": "Ändern",
|
||||
"existingVersions": "Vorhandene Versionen:",
|
||||
"usingRelease": "Verwende {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} Bonus",
|
||||
"variantOriginal": "Original",
|
||||
"variantReissue": "Neuauflage"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Καλλιτέχνης",
|
||||
"buyCredits": "Αγορά μονάδων",
|
||||
"removeRow": "Αφαίρεση",
|
||||
"trackCount": "{count} κομμάτια"
|
||||
"trackCount": "{count} κομμάτια",
|
||||
"changeEdition": "Αλλαγή",
|
||||
"existingVersions": "Υπάρχουσες εκδόσεις:",
|
||||
"usingRelease": "Χρησιμοποιείς {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} μπόνους",
|
||||
"variantOriginal": "Πρωτότυπο",
|
||||
"variantReissue": "Επανέκδοση"
|
||||
}
|
||||
}
|
||||
@@ -1621,6 +1621,12 @@
|
||||
"extra": "Extra",
|
||||
"communityExists": "Community version exists",
|
||||
"communityExistsWithBrands": "Community version: {brands}",
|
||||
"existingVersions": "Existing versions:",
|
||||
"usingRelease": "Using {label} · {year} · {tracks}",
|
||||
"changeEdition": "Change",
|
||||
"variantOriginal": "Original",
|
||||
"variantReissue": "Reissue",
|
||||
"variantBonus": "+{count} bonus",
|
||||
"batchSettings": "Batch settings",
|
||||
"autoPickLossless": "Auto-pick best audio (lossless only)",
|
||||
"autoPickLosslessHint": "Automatically choose the audio when we find a confident lossless/FLAC match. Others go to a review queue.",
|
||||
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Artista",
|
||||
"buyCredits": "Comprar créditos",
|
||||
"removeRow": "Quitar",
|
||||
"trackCount": "{count} pistas"
|
||||
"trackCount": "{count} pistas",
|
||||
"changeEdition": "Cambiar",
|
||||
"existingVersions": "Versiones existentes:",
|
||||
"usingRelease": "Usando {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} bonus",
|
||||
"variantOriginal": "Original",
|
||||
"variantReissue": "Reedición"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Artisti",
|
||||
"buyCredits": "Osta krediittejä",
|
||||
"removeRow": "Poista",
|
||||
"trackCount": "{count} raitaa"
|
||||
"trackCount": "{count} raitaa",
|
||||
"changeEdition": "Vaihda",
|
||||
"existingVersions": "Olemassa olevat versiot:",
|
||||
"usingRelease": "Käytössä {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} bonusta",
|
||||
"variantOriginal": "Alkuperäinen",
|
||||
"variantReissue": "Uudelleenjulkaisu"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Artiste",
|
||||
"buyCredits": "Acheter des crédits",
|
||||
"removeRow": "Retirer",
|
||||
"trackCount": "{count} pistes"
|
||||
"trackCount": "{count} pistes",
|
||||
"changeEdition": "Modifier",
|
||||
"existingVersions": "Versions existantes :",
|
||||
"usingRelease": "Utilisation de {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} bonus",
|
||||
"variantOriginal": "Originale",
|
||||
"variantReissue": "Réédition"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "אומן",
|
||||
"buyCredits": "רכישת קרדיטים",
|
||||
"removeRow": "הסרה",
|
||||
"trackCount": "{count} רצועות"
|
||||
"trackCount": "{count} רצועות",
|
||||
"changeEdition": "שינוי",
|
||||
"existingVersions": "גרסאות קיימות:",
|
||||
"usingRelease": "שימוש ב-{label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} בונוס",
|
||||
"variantOriginal": "מקורי",
|
||||
"variantReissue": "הוצאה מחודשת"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "कलाकार",
|
||||
"buyCredits": "क्रेडिट्स खरीदो",
|
||||
"removeRow": "हटाओ",
|
||||
"trackCount": "{count} ट्रैक्स"
|
||||
"trackCount": "{count} ट्रैक्स",
|
||||
"changeEdition": "बदलो",
|
||||
"existingVersions": "मौजूदा संस्करण:",
|
||||
"usingRelease": "{label} · {year} · {tracks} का इस्तेमाल कर रहे हो",
|
||||
"variantBonus": "+{count} बोनस",
|
||||
"variantOriginal": "मूल",
|
||||
"variantReissue": "रीइश्यू"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Izvođač",
|
||||
"buyCredits": "Kupi kredite",
|
||||
"removeRow": "Ukloni",
|
||||
"trackCount": "{count} pjesama"
|
||||
"trackCount": "{count} pjesama",
|
||||
"changeEdition": "Promijeni",
|
||||
"existingVersions": "Postojeće verzije:",
|
||||
"usingRelease": "Koristiš {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} bonus",
|
||||
"variantOriginal": "Original",
|
||||
"variantReissue": "Reizdanje"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Előadó",
|
||||
"buyCredits": "Kredit vásárlása",
|
||||
"removeRow": "Eltávolítás",
|
||||
"trackCount": "{count} szám"
|
||||
"trackCount": "{count} szám",
|
||||
"changeEdition": "Módosítás",
|
||||
"existingVersions": "Meglévő verziók:",
|
||||
"usingRelease": "Használatban: {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} bónusz",
|
||||
"variantOriginal": "Eredeti",
|
||||
"variantReissue": "Újrakiadás"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Artis",
|
||||
"buyCredits": "Beli kredit",
|
||||
"removeRow": "Hapus",
|
||||
"trackCount": "{count} trek"
|
||||
"trackCount": "{count} trek",
|
||||
"changeEdition": "Ubah",
|
||||
"existingVersions": "Versi yang ada:",
|
||||
"usingRelease": "Menggunakan {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} bonus",
|
||||
"variantOriginal": "Original",
|
||||
"variantReissue": "Rilis ulang"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Artista",
|
||||
"buyCredits": "Acquista crediti",
|
||||
"removeRow": "Rimuovi",
|
||||
"trackCount": "{count} tracce"
|
||||
"trackCount": "{count} tracce",
|
||||
"changeEdition": "Cambia",
|
||||
"existingVersions": "Versioni esistenti:",
|
||||
"usingRelease": "Utilizzando {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} bonus",
|
||||
"variantOriginal": "Originale",
|
||||
"variantReissue": "Ristampa"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "アーティスト",
|
||||
"buyCredits": "クレジットを購入",
|
||||
"removeRow": "削除",
|
||||
"trackCount": "{count}トラック"
|
||||
"trackCount": "{count}トラック",
|
||||
"changeEdition": "変更",
|
||||
"existingVersions": "既存のバージョン:",
|
||||
"usingRelease": "{label} · {year} · {tracks} を使用",
|
||||
"variantBonus": "+{count} ボーナス",
|
||||
"variantOriginal": "オリジナル",
|
||||
"variantReissue": "リイシュー"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "아티스트",
|
||||
"buyCredits": "크레딧 구매",
|
||||
"removeRow": "제거",
|
||||
"trackCount": "{count} 트랙"
|
||||
"trackCount": "{count} 트랙",
|
||||
"changeEdition": "변경",
|
||||
"existingVersions": "기존 버전:",
|
||||
"usingRelease": "{label} · {year} · {tracks} 사용 중",
|
||||
"variantBonus": "+{count} 보너스",
|
||||
"variantOriginal": "오리지널",
|
||||
"variantReissue": "재발매"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Artis",
|
||||
"buyCredits": "Beli kredit",
|
||||
"removeRow": "Alih keluar",
|
||||
"trackCount": "{count} trek"
|
||||
"trackCount": "{count} trek",
|
||||
"changeEdition": "Tukar",
|
||||
"existingVersions": "Versi sedia ada:",
|
||||
"usingRelease": "Menggunakan {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} bonus",
|
||||
"variantOriginal": "Asal",
|
||||
"variantReissue": "Keluaran semula"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Artist",
|
||||
"buyCredits": "Kjøp kreditter",
|
||||
"removeRow": "Fjern",
|
||||
"trackCount": "{count} spor"
|
||||
"trackCount": "{count} spor",
|
||||
"changeEdition": "Endre",
|
||||
"existingVersions": "Eksisterende versjoner:",
|
||||
"usingRelease": "Bruker {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} bonus",
|
||||
"variantOriginal": "Original",
|
||||
"variantReissue": "Nyutgivelse"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Artiest",
|
||||
"buyCredits": "Credits kopen",
|
||||
"removeRow": "Verwijderen",
|
||||
"trackCount": "{count} tracks"
|
||||
"trackCount": "{count} tracks",
|
||||
"changeEdition": "Wijzigen",
|
||||
"existingVersions": "Bestaande versies:",
|
||||
"usingRelease": "Gebruikt {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} bonus",
|
||||
"variantOriginal": "Origineel",
|
||||
"variantReissue": "Heruitgave"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Wykonawca",
|
||||
"buyCredits": "Kup kredyty",
|
||||
"removeRow": "Usuń",
|
||||
"trackCount": "{count} utworów"
|
||||
"trackCount": "{count} utworów",
|
||||
"changeEdition": "Zmień",
|
||||
"existingVersions": "Istniejące wersje:",
|
||||
"usingRelease": "Używasz {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} bonus",
|
||||
"variantOriginal": "Oryginał",
|
||||
"variantReissue": "Reedycja"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Artista",
|
||||
"buyCredits": "Comprar créditos",
|
||||
"removeRow": "Remover",
|
||||
"trackCount": "{count} faixas"
|
||||
"trackCount": "{count} faixas",
|
||||
"changeEdition": "Alterar",
|
||||
"existingVersions": "Versões existentes:",
|
||||
"usingRelease": "Usando {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} bônus",
|
||||
"variantOriginal": "Original",
|
||||
"variantReissue": "Reedição"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Artist",
|
||||
"buyCredits": "Cumpără credite",
|
||||
"removeRow": "Elimină",
|
||||
"trackCount": "{count} piese"
|
||||
"trackCount": "{count} piese",
|
||||
"changeEdition": "Schimbă",
|
||||
"existingVersions": "Versiuni existente:",
|
||||
"usingRelease": "Folosind {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} bonus",
|
||||
"variantOriginal": "Original",
|
||||
"variantReissue": "Reeditare"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Исполнитель",
|
||||
"buyCredits": "Купить кредиты",
|
||||
"removeRow": "Удалить",
|
||||
"trackCount": "{count} треков"
|
||||
"trackCount": "{count} треков",
|
||||
"changeEdition": "Изменить",
|
||||
"existingVersions": "Существующие версии:",
|
||||
"usingRelease": "Используется {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} бонус",
|
||||
"variantOriginal": "Оригинал",
|
||||
"variantReissue": "Переиздание"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Interpret",
|
||||
"buyCredits": "Kúpiť kredity",
|
||||
"removeRow": "Odstrániť",
|
||||
"trackCount": "{count} skladieb"
|
||||
"trackCount": "{count} skladieb",
|
||||
"changeEdition": "Zmeniť",
|
||||
"existingVersions": "Existujúce verzie:",
|
||||
"usingRelease": "Používa sa {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} bonus",
|
||||
"variantOriginal": "Originál",
|
||||
"variantReissue": "Reedícia"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Artist",
|
||||
"buyCredits": "Köp krediter",
|
||||
"removeRow": "Ta bort",
|
||||
"trackCount": "{count} spår"
|
||||
"trackCount": "{count} spår",
|
||||
"changeEdition": "Ändra",
|
||||
"existingVersions": "Befintliga versioner:",
|
||||
"usingRelease": "Använder {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} bonus",
|
||||
"variantOriginal": "Original",
|
||||
"variantReissue": "Nyutgåva"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "ศิลปิน",
|
||||
"buyCredits": "ซื้อเครดิต",
|
||||
"removeRow": "นำออก",
|
||||
"trackCount": "{count} แทร็ก"
|
||||
"trackCount": "{count} แทร็ก",
|
||||
"changeEdition": "เปลี่ยน",
|
||||
"existingVersions": "เวอร์ชันที่มีอยู่:",
|
||||
"usingRelease": "กำลังใช้ {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} โบนัส",
|
||||
"variantOriginal": "ต้นฉบับ",
|
||||
"variantReissue": "วางจำหน่ายใหม่"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Artist",
|
||||
"buyCredits": "Bumili ng credits",
|
||||
"removeRow": "Alisin",
|
||||
"trackCount": "{count} na track"
|
||||
"trackCount": "{count} na track",
|
||||
"changeEdition": "Palitan",
|
||||
"existingVersions": "Mga kasalukuyang bersyon:",
|
||||
"usingRelease": "Ginagamit ang {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} bonus",
|
||||
"variantOriginal": "Orihinal",
|
||||
"variantReissue": "Muling inilabas"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Sanatçı",
|
||||
"buyCredits": "Kredi satın al",
|
||||
"removeRow": "Kaldır",
|
||||
"trackCount": "{count} parça"
|
||||
"trackCount": "{count} parça",
|
||||
"changeEdition": "Değiştir",
|
||||
"existingVersions": "Mevcut sürümler:",
|
||||
"usingRelease": "{label} · {year} · {tracks} kullanılıyor",
|
||||
"variantBonus": "+{count} bonus",
|
||||
"variantOriginal": "Orijinal",
|
||||
"variantReissue": "Yeniden basım"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Виконавець",
|
||||
"buyCredits": "Купити кредити",
|
||||
"removeRow": "Видалити",
|
||||
"trackCount": "{count} треків"
|
||||
"trackCount": "{count} треків",
|
||||
"changeEdition": "Змінити",
|
||||
"existingVersions": "Наявні версії:",
|
||||
"usingRelease": "Використовується {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} бонус",
|
||||
"variantOriginal": "Оригінал",
|
||||
"variantReissue": "Перевидання"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "Nghệ sĩ",
|
||||
"buyCredits": "Mua credit",
|
||||
"removeRow": "Xóa",
|
||||
"trackCount": "{count} bản nhạc"
|
||||
"trackCount": "{count} bản nhạc",
|
||||
"changeEdition": "Thay đổi",
|
||||
"existingVersions": "Các phiên bản hiện có:",
|
||||
"usingRelease": "Đang sử dụng {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} tặng kèm",
|
||||
"variantOriginal": "Bản gốc",
|
||||
"variantReissue": "Tái bản"
|
||||
}
|
||||
}
|
||||
@@ -1648,6 +1648,12 @@
|
||||
"artist": "歌手",
|
||||
"buyCredits": "购买点数",
|
||||
"removeRow": "移除",
|
||||
"trackCount": "{count} 首曲目"
|
||||
"trackCount": "{count} 首曲目",
|
||||
"changeEdition": "更改",
|
||||
"existingVersions": "现有版本:",
|
||||
"usingRelease": "使用 {label} · {year} · {tracks}",
|
||||
"variantBonus": "+{count} 附加曲目",
|
||||
"variantOriginal": "原版",
|
||||
"variantReissue": "再版"
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "karaoke-gen"
|
||||
version = "0.187.5"
|
||||
version = "0.188.2"
|
||||
description = "Generate karaoke videos with synchronized lyrics. Handles the entire process from downloading audio and lyrics to creating the final video with title screens."
|
||||
authors = ["Andrew Beveridge <andrew@beveridge.uk>"]
|
||||
license = "MIT"
|
||||
|
||||
Reference in new issue
Block a user