Skip to content

Commit

Permalink
Fix: remove webradios after 31 failed checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed Sep 27, 2024
1 parent 7632516 commit b987a75
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ delete_radio_by_m3u() {
exit 1
fi
fi
if [ -f "${MOODE_PLS_DIR}/${PLIST}.m3u" ]
elif [ -f "${MOODE_PLS_DIR}/${PLIST}.m3u" ]
then
echo "Deleting webradio ${PLIST}"
if mv "${MOODE_PLS_DIR}/${PLIST}.m3u" "${TRASH_DIR}"
Expand All @@ -691,6 +691,9 @@ delete_radio_by_m3u() {
fi
echo "Adding webradio $PLIST to moode-ignore"
echo "${PLIST}" >> mappings/moode-ignore
else
echo "Webradio ${PLIST} not found"
exit 1
fi
}

Expand Down Expand Up @@ -1306,7 +1309,8 @@ check_stream_all_json() {
ERROR_COUNT=$((ERROR_COUNT+1))
if [ "$ERROR_COUNT" -gt 31 ]
then
delete_radio_by_m3u "$M3U"
local M3U_NAME=$(trim_ext "$M3U")
delete_radio_by_m3u "$M3U_NAME"
else
printf "\"%s\":{\"date\":\"%s\",\"count\":%s,\"error\":%s}" "$M3U" "$DATE" "$ERROR_COUNT" "$OUT" >&3
ENTRY_COUNT=$((ENTRY_COUNT+1))
Expand Down

0 comments on commit b987a75

Please sign in to comment.