diff --git a/apps/epg/tasks.py b/apps/epg/tasks.py
index 33e981a6..9bfce9fe 100644
--- a/apps/epg/tasks.py
+++ b/apps/epg/tasks.py
@@ -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)
diff --git a/apps/m3u/tasks.py b/apps/m3u/tasks.py
index 3529e1ef..5db25e2a 100644
--- a/apps/m3u/tasks.py
+++ b/apps/m3u/tasks.py
@@ -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)
diff --git a/frontend/src/api.js b/frontend/src/api.js
index 94183a10..92dc84e8 100644
--- a/frontend/src/api.js
+++ b/frontend/src/api.js
@@ -712,6 +712,7 @@ export default class API {
if (!payload.url) {
delete payload.url;
}
+ body = payload;
}
const response = await request(`${host}/api/epg/sources/${id}/`, {
diff --git a/frontend/src/components/tables/EPGsTable.jsx b/frontend/src/components/tables/EPGsTable.jsx
index 31b71077..9da2b114 100644
--- a/frontend/src/components/tables/EPGsTable.jsx
+++ b/frontend/src/components/tables/EPGsTable.jsx
@@ -13,6 +13,7 @@ import {
Button,
Flex,
useMantineTheme,
+ Switch,
} from '@mantine/core';
import { notifications } from '@mantine/notifications';
import { IconSquarePlus } from '@tabler/icons-react';
@@ -25,10 +26,16 @@ const EPGsTable = () => {
const [rowSelection, setRowSelection] = useState([]);
const { epgs } = useEPGsStore();
- console.log(epgs);
const theme = useMantineTheme();
+ const toggleActive = async (epg) => {
+ await API.updateEPG({
+ ...epg,
+ is_active: !epg.is_active,
+ });
+ };
+
const columns = useMemo(
//column definitions...
() => [
@@ -45,6 +52,24 @@ const EPGsTable = () => {
accessorKey: 'url',
enableSorting: false,
},
+ {
+ header: 'Active',
+ accessorKey: 'is_active',
+ size: 100,
+ sortingFn: 'basic',
+ mantineTableBodyCellProps: {
+ align: 'left',
+ },
+ Cell: ({ row, cell }) => (
+
+ toggleActive(row.original)}
+ />
+
+ ),
+ },
{
header: 'Updated',
accessorFn: (row) => dayjs(row.updated_at).format('MMMM D, YYYY h:mma'),
@@ -142,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}
>
{/* Small icon size */}
diff --git a/frontend/src/components/tables/M3UsTable.jsx b/frontend/src/components/tables/M3UsTable.jsx
index c4bd273a..0fccfc82 100644
--- a/frontend/src/components/tables/M3UsTable.jsx
+++ b/frontend/src/components/tables/M3UsTable.jsx
@@ -13,6 +13,7 @@ import {
Box,
ActionIcon,
Tooltip,
+ Switch,
} from '@mantine/core';
import { SquareMinus, SquarePen, RefreshCcw, Check, X } from 'lucide-react';
import { IconSquarePlus } from '@tabler/icons-react'; // Import custom icons
@@ -84,6 +85,13 @@ const M3UTable = () => {
return `Parsing: ${data.progress}%`;
};
+ const toggleActive = async (playlist) => {
+ await API.updatePlaylist({
+ ...playlist,
+ is_active: !playlist.is_active,
+ });
+ };
+
const columns = useMemo(
//column definitions...
() => [
@@ -133,9 +141,13 @@ const M3UTable = () => {
mantineTableBodyCellProps: {
align: 'left',
},
- Cell: ({ cell }) => (
+ Cell: ({ row, cell }) => (
- {cell.getValue() ? : }
+ toggleActive(row.original)}
+ />
),
},
@@ -251,6 +263,7 @@ const M3UTable = () => {
size="sm"
color="blue.5"
onClick={() => refreshPlaylist(row.original.id)}
+ disabled={!row.original.is_active}
>
diff --git a/version.py b/version.py
index f0337a7a..4a10d9ca 100644
--- a/version.py
+++ b/version.py
@@ -2,4 +2,4 @@
Dispatcharr version information.
"""
__version__ = '0.1.0' # Follow semantic versioning (MAJOR.MINOR.PATCH)
-__build__ = '23' # Auto-incremented on builds
+__build__ = '24' # Auto-incremented on builds