Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions .github/workflows/lyrics-reimplementation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
name: Build lyrics reimplementation

on:
push:
branches:
- feature/lyrics-reimplementation
pull_request:
branches:
- main

permissions:
contents: write

jobs:
generate:
if: ${{ !contains(github.event.head_commit.message, '[lyrics-generated]') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: feature/lyrics-reimplementation
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install native validation tools
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq gettext libglib2.0-bin zip

- name: Install dependencies
run: |
corepack enable
pnpm install --frozen-lockfile --silent

- name: Apply implementation
id: apply
continue-on-error: true
run: |
python3 - <<'PY'
from pathlib import Path
path = Path('scripts/apply_lyrics_reimplementation.py')
source = path.read_text(encoding='utf-8')
old = 'replace_once("assets/ui/prefs.ui", metadata_anchor, lyrics_group + metadata_anchor)'
new = '''prefs_ui = read("assets/ui/prefs.ui")
metadata_index = prefs_ui.index(metadata_anchor)
write(
"assets/ui/prefs.ui",
prefs_ui[:metadata_index] + lyrics_group + prefs_ui[metadata_index:],
)'''
if old not in source:
raise SystemExit('preferences generator anchor missing')
path.write_text(source.replace(old, new, 1), encoding='utf-8')
PY
python3 scripts/apply_lyrics_reimplementation.py > /tmp/lyrics-apply.log 2>&1

- uses: actions/upload-artifact@v4
if: steps.apply.outcome == 'failure'
with:
name: lyrics-apply-error
path: /tmp/lyrics-apply.log

- name: Persist generator failure
if: steps.apply.outcome == 'failure'
run: |
cp /tmp/lyrics-apply.log lyrics-apply-error.txt
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add lyrics-apply-error.txt
git commit -m '[lyrics-error] chore: capture generator failure' || true
git push origin HEAD:feature/lyrics-reimplementation || true
cat /tmp/lyrics-apply.log
exit 1

- name: Update translations
run: |
pnpm run translations
python3 scripts/apply_lyrics_reimplementation.py --translations

- name: Validate
id: validate
continue-on-error: true
shell: bash
run: |
set -o pipefail
pnpm check 2>&1 | tee /tmp/MediaShell-lyrics-validation.txt
git diff --check 2>&1 | tee -a /tmp/MediaShell-lyrics-validation.txt

- uses: actions/upload-artifact@v4
if: steps.validate.outcome == 'failure'
with:
name: lyrics-validation-error
path: /tmp/MediaShell-lyrics-validation.txt

- name: Persist validation failure
if: steps.validate.outcome == 'failure'
run: |
cp /tmp/MediaShell-lyrics-validation.txt lyrics-validation-error.txt
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add lyrics-validation-error.txt
git commit -m '[lyrics-error] chore: capture validation failure' || true
git push origin HEAD:feature/lyrics-reimplementation || true
tail -n 120 /tmp/MediaShell-lyrics-validation.txt
exit 1

- name: Prepare clean artifacts
run: |
rm -f .github/workflows/lyrics-reimplementation.yml
rm -f scripts/apply_lyrics_reimplementation.py
rm -f lyrics-apply-error.txt lyrics-validation-error.txt
git diff 367fe96f7e89ee18e94a60ab487a631561bbe94f > /tmp/MediaShell-lyrics-reimplementation.patch
zip -qr /tmp/MediaShell-lyrics-reimplementation-source.zip . \
-x '.git/*' 'node_modules/*' 'dist/*'
cat > /tmp/MediaShell-lyrics-report.md <<'EOF'
# MediaShell synchronized lyrics reimplementation

Built from the clean 2.0.0 source at commit `367fe96f7e89ee18e94a60ab487a631561bbe94f`.

The implementation uses LRCLIB, a bounded session-only cache, cancellable Soup requests, a temporary edge-to-edge lyrics mode, centered synchronized scrolling, plain-lyrics fallback, seek-on-line support, one unified unavailable state, and complete translations for every existing catalog.

No persistent lyrics cache, cache preference, additional validation script, or private GNOME Shell API was added.
EOF

- name: Commit generated source
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add -A
git commit -m '[lyrics-generated] feat(popup): add synchronized lyrics'
git push origin HEAD:feature/lyrics-reimplementation

- uses: actions/upload-artifact@v4
with:
name: MediaShell-lyrics-reimplementation
path: |
/tmp/MediaShell-lyrics-reimplementation-source.zip
/tmp/MediaShell-lyrics-reimplementation.patch
/tmp/MediaShell-lyrics-report.md
/tmp/MediaShell-lyrics-validation.txt
if-no-files-found: error
6 changes: 6 additions & 0 deletions lyrics-apply-error.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Traceback (most recent call last):
File "/home/runner/work/MediaShell/MediaShell/scripts/apply_lyrics_reimplementation.py", line 2295, in <module>
replace_once("assets/ui/prefs.ui", metadata_anchor, lyrics_group + metadata_anchor)
File "/home/runner/work/MediaShell/MediaShell/scripts/apply_lyrics_reimplementation.py", line 27, in replace_once
raise RuntimeError(f"Expected one anchor in {path}, found {count}: {old[:80]!r}")
RuntimeError: Expected one anchor in assets/ui/prefs.ui, found 2: ' <child>\n <object class="AdwPreferencesGroup">\n <property name="t'
22 changes: 22 additions & 0 deletions lyrics-validation-error.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

> mediashell@2.0.0 check /home/runner/work/MediaShell/MediaShell
> node scripts/check.mjs


==> JavaScript syntax
JavaScript syntax passed for 104 modules.

==> module documentation
Module documentation validation failed:
- src/shared/utils/lyricsCache.js:17: class declaration must have a compact JSDoc comment
- src/shell/services/lyrics/LrclibClient.js:52: class declaration must have a compact JSDoc comment
- src/shell/services/lyrics/LyricsResolver.js:30: class declaration must have a compact JSDoc comment
- src/shell/ui/popup/PopupContent.js:28: class declaration must have a compact JSDoc comment
- src/shell/ui/popup/PopupLyricsController.js:29: class declaration must have a compact JSDoc comment
- src/shell/ui/popup/PopupLyricsLayout.js:30: class declaration must have a compact JSDoc comment
- src/shell/ui/popup/PopupLyricsStatus.js:18: class declaration must have a compact JSDoc comment
- src/shell/ui/popup/PopupLyricsView.js:31: class declaration must have a compact JSDoc comment
- src/shell/ui/popup/PopupPlaybackControls.js:40: class declaration must have a compact JSDoc comment
- tests/lrc.test.mjs: missing module header
- tests/lyrics.test.mjs: missing module header
 ELIFECYCLE  Command failed with exit code 1.
Loading