Update .forgejo/workflows/generate-m3u.yml
Some checks are pending
Generate M3U Playlist with Auto-Organization / build-and-organize (push) Waiting to run
Some checks are pending
Generate M3U Playlist with Auto-Organization / build-and-organize (push) Waiting to run
This commit is contained in:
parent
fa3f75a62e
commit
5021141f85
1 changed files with 12 additions and 36 deletions
|
@ -9,8 +9,6 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build-and-organize:
|
build-and-organize:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
timeout-minutes: 5
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
@ -25,7 +23,7 @@ jobs:
|
||||||
echo "Setting up Python environment..."
|
echo "Setting up Python environment..."
|
||||||
python3 --version
|
python3 --version
|
||||||
echo "Setting up directories..."
|
echo "Setting up directories..."
|
||||||
mkdir -p reports/daily reports/logs backups config logs
|
mkdir -p reports/daily reports/logs backups config
|
||||||
echo "Setup completed"
|
echo "Setup completed"
|
||||||
|
|
||||||
- name: Check Import File
|
- name: Check Import File
|
||||||
|
@ -34,9 +32,6 @@ jobs:
|
||||||
if [ -f bulk_import.m3u ]; then
|
if [ -f bulk_import.m3u ]; then
|
||||||
LINES=$(wc -l < bulk_import.m3u)
|
LINES=$(wc -l < bulk_import.m3u)
|
||||||
echo "Found bulk_import.m3u with $LINES lines"
|
echo "Found bulk_import.m3u with $LINES lines"
|
||||||
if [ "$LINES" -le 2 ]; then
|
|
||||||
echo "Import file is empty or only has header"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "Creating empty bulk_import.m3u"
|
echo "Creating empty bulk_import.m3u"
|
||||||
echo '#EXTM3U' > bulk_import.m3u
|
echo '#EXTM3U' > bulk_import.m3u
|
||||||
|
@ -54,55 +49,36 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Run Playlist Generation
|
- name: Run Playlist Generation
|
||||||
timeout-minutes: 3
|
|
||||||
run: |
|
run: |
|
||||||
echo "Running playlist generation..."
|
echo "Running playlist generation..."
|
||||||
cd scripts
|
cd scripts
|
||||||
if [ -f generate_playlist.py ]; then
|
if [ -f generate_playlist.py ]; then
|
||||||
echo "Found generate_playlist.py, executing..."
|
echo "Found generate_playlist.py, executing..."
|
||||||
timeout 120 python3 generate_playlist.py
|
python3 generate_playlist.py
|
||||||
echo "Playlist generation completed"
|
echo "Playlist generation completed"
|
||||||
else
|
else
|
||||||
echo "Error: generate_playlist.py not found"
|
echo "Error: generate_playlist.py not found"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Check Results
|
|
||||||
run: |
|
|
||||||
echo "Checking generation results..."
|
|
||||||
if [ -f playlist.m3u ]; then
|
|
||||||
CHANNELS=$(grep -c "^#EXTINF" playlist.m3u || echo "0")
|
|
||||||
echo "✅ Generated playlist.m3u with $CHANNELS channels"
|
|
||||||
SIZE=$(wc -c < playlist.m3u)
|
|
||||||
echo "File size: $SIZE bytes"
|
|
||||||
else
|
|
||||||
echo "❌ No playlist.m3u generated"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f channels.txt ]; then
|
|
||||||
LINES=$(wc -l < channels.txt)
|
|
||||||
echo "✅ channels.txt has $LINES lines"
|
|
||||||
else
|
|
||||||
echo "ℹ️ No channels.txt found"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Create Simple Report
|
- name: Create Simple Report
|
||||||
run: |
|
run: |
|
||||||
echo "Creating report..."
|
echo "Creating report..."
|
||||||
DATE=$(date +%Y%m%d_%H%M%S)
|
|
||||||
REPORT="reports/daily/report_$DATE.md"
|
|
||||||
|
|
||||||
echo "# Playlist Report" > "$REPORT"
|
|
||||||
echo "Generated: $(date)" >> "$REPORT"
|
|
||||||
|
|
||||||
if [ -f playlist.m3u ]; then
|
if [ -f playlist.m3u ]; then
|
||||||
CHANNELS=$(grep -c "^#EXTINF" playlist.m3u || echo "0")
|
CHANNELS=$(grep -c "^#EXTINF" playlist.m3u || echo "0")
|
||||||
echo "Channels: $CHANNELS" >> "$REPORT"
|
echo "Found $CHANNELS channels in playlist"
|
||||||
else
|
|
||||||
echo "Channels: 0" >> "$REPORT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Report created: $REPORT"
|
DATE=$(date +%Y%m%d_%H%M%S)
|
||||||
|
REPORT="reports/daily/report_$DATE.md"
|
||||||
|
|
||||||
|
echo "# Playlist Report" > "$REPORT"
|
||||||
|
echo "Generated: $(date)" >> "$REPORT"
|
||||||
|
echo "Channels: $CHANNELS" >> "$REPORT"
|
||||||
|
|
||||||
|
echo "Report created: $REPORT"
|
||||||
|
else
|
||||||
|
echo "No playlist found"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Clean Old Reports
|
- name: Clean Old Reports
|
||||||
run: |
|
run: |
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue