disabled refresh button on inactive items, don't process them in inactive

This commit is contained in:
dekzter 2025-04-11 17:18:32 -04:00
parent 348c471e26
commit 8bf75293fb
4 changed files with 10 additions and 0 deletions

View file

@ -42,6 +42,10 @@ def refresh_epg_data(source_id):
return
source = EPGSource.objects.get(id=source_id)
if not source.is_active:
logger.info(f"EPG source {source_id} is not active. Skipping.")
return
logger.info(f"Processing EPGSource: {source.name} (type: {source.source_type})")
if source.source_type == 'xmltv':
fetch_xmltv(source)

View file

@ -383,6 +383,10 @@ def refresh_single_m3u_account(account_id):
try:
account = M3UAccount.objects.get(id=account_id, is_active=True)
if not account.is_active:
logger.info(f"Account {account_id} is not active, skipping.")
return
filters = list(account.filters.all())
except M3UAccount.DoesNotExist:
release_task_lock('refresh_single_m3u_account', account_id)

View file

@ -167,6 +167,7 @@ const EPGsTable = () => {
size="sm" // Makes the button smaller
color="blue.5" // Red color for delete actions
onClick={() => refreshEPG(row.original.id)}
disabled={!row.original.is_active}
>
<RefreshCcw size="18" /> {/* Small icon size */}
</ActionIcon>

View file

@ -263,6 +263,7 @@ const M3UTable = () => {
size="sm"
color="blue.5"
onClick={() => refreshPlaylist(row.original.id)}
disabled={!row.original.is_active}
>
<RefreshCcw size="18" />
</ActionIcon>