From 2ef9ab0dcffdc3e8e93e1794991192f4df496f32 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Thu, 30 Apr 2026 16:01:55 -0500 Subject: [PATCH] Refactor: Remove unused stream deactivation and filtering methods from M3UAccount and M3UFilter classes --- apps/m3u/models.py | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/apps/m3u/models.py b/apps/m3u/models.py index fbe22d8c..c1cb5a99 100644 --- a/apps/m3u/models.py +++ b/apps/m3u/models.py @@ -111,18 +111,6 @@ class M3UAccount(models.Model): def display_action(self): return "Exclude" if self.exclude else "Include" - def deactivate_streams(self): - """Deactivate all streams linked to this account.""" - for stream in self.streams.all(): - stream.is_active = False - stream.save() - - def reactivate_streams(self): - """Reactivate all streams linked to this account.""" - for stream in self.streams.all(): - stream.is_active = True - stream.save() - @classmethod def get_custom_account(cls): return cls.objects.get(name=CUSTOM_M3U_ACCOUNT_NAME, locked=True) @@ -205,25 +193,6 @@ class M3UFilter(models.Model): exclude_status = "Exclude" if self.exclude else "Include" return f"[{self.m3u_account.name}] {filter_type_display}: {self.regex_pattern} ({exclude_status})" - @staticmethod - def filter_streams(streams, filters): - included_streams = set() - excluded_streams = set() - - for f in filters: - for stream in streams: - if f.applies_to(stream.name, stream.group_name): - if f.exclude: - excluded_streams.add(stream) - else: - included_streams.add(stream) - - # If no include filters exist, assume all non-excluded streams are valid - if not any(not f.exclude for f in filters): - return streams.exclude(id__in=[s.id for s in excluded_streams]) - - return streams.filter(id__in=[s.id for s in included_streams]) - class ServerGroup(models.Model): """Represents a logical grouping of servers or channels."""