Use FilterSeconds in models.py

This commit is contained in:
tcely 2025-02-12 23:52:35 -05:00 committed by GitHub
parent edd320b786
commit f4b34bafd0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,7 +27,7 @@ from .matching import (get_best_combined_format, get_best_audio_format,
from .mediaservers import PlexMediaServer from .mediaservers import PlexMediaServer
from .fields import CommaSepChoiceField from .fields import CommaSepChoiceField
from .choices import (V, CapChoices, Fallback, FileExtension, from .choices import (V, CapChoices, Fallback, FileExtension,
IndexSchedule, MediaServerType, FilterSeconds, IndexSchedule, MediaServerType,
SourceResolution, SourceResolutionInteger, SourceResolution, SourceResolutionInteger,
SponsorBlock_Category, YouTube_AudioCodec, SponsorBlock_Category, YouTube_AudioCodec,
YouTube_SourceType, YouTube_VideoCodec) YouTube_SourceType, YouTube_VideoCodec)
@ -58,11 +58,6 @@ class Source(models.Model):
FALLBACK_NEXT_BEST = V(Fallback.NEXT_BEST) FALLBACK_NEXT_BEST = V(Fallback.NEXT_BEST)
FALLBACK_NEXT_BEST_HD = V(Fallback.NEXT_BEST_HD) FALLBACK_NEXT_BEST_HD = V(Fallback.NEXT_BEST_HD)
FILTER_SECONDS_CHOICES = (
(True, _('Minimum Length')),
(False, _('Maximum Length')),
)
sponsorblock_categories = CommaSepChoiceField( sponsorblock_categories = CommaSepChoiceField(
_(''), _(''),
max_length=128, max_length=128,
@ -234,8 +229,8 @@ class Source(models.Model):
) )
filter_seconds_min = models.BooleanField( filter_seconds_min = models.BooleanField(
_('filter seconds min/max'), _('filter seconds min/max'),
choices=FILTER_SECONDS_CHOICES, choices=FilterSeconds.choices,
default=True, default=V(FilterSeconds.MIN),
help_text=_('When Filter Seconds is > 0, do we skip on minimum (video shorter than limit) or maximum (video ' help_text=_('When Filter Seconds is > 0, do we skip on minimum (video shorter than limit) or maximum (video '
'greater than maximum) video duration') 'greater than maximum) video duration')
) )