mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-01-23 02:35:14 +00:00
Combined migrations
This commit is contained in:
parent
f652d2b233
commit
7401b4c8d3
2 changed files with 3 additions and 27 deletions
|
|
@ -4,7 +4,7 @@ from django.db import migrations
|
|||
from django.utils.text import slugify
|
||||
|
||||
|
||||
def add_dvr_templates(apps, schema_editor):
|
||||
def add_dvr_defaults(apps, schema_editor):
|
||||
CoreSettings = apps.get_model("core", "CoreSettings")
|
||||
|
||||
defaults = [
|
||||
|
|
@ -12,8 +12,7 @@ def add_dvr_templates(apps, schema_editor):
|
|||
(slugify("DVR Movie Template"), "DVR Movie Template", "Recordings/Movies/{title} ({year}).mkv"),
|
||||
(slugify("DVR TV Fallback Template"), "DVR TV Fallback Template", "Recordings/TV_Shows/{show}/{start}.mkv"),
|
||||
(slugify("DVR Movie Fallback Template"), "DVR Movie Fallback Template", "Recordings/Movies/{start}.mkv"),
|
||||
# Legacy support (older builds looked up a fallback folder name)
|
||||
(slugify("DVR TV Fallback Dir"), "DVR TV Fallback Dir", "TV_Shows"),
|
||||
(slugify("DVR Comskip Enabled"), "DVR Comskip Enabled", "false"),
|
||||
]
|
||||
|
||||
for key, name, value in defaults:
|
||||
|
|
@ -27,5 +26,5 @@ class Migration(migrations.Migration):
|
|||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(add_dvr_templates),
|
||||
migrations.RunPython(add_dvr_defaults),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
from django.db import migrations
|
||||
from django.utils.text import slugify
|
||||
|
||||
|
||||
def add_comskip_setting(apps, schema_editor):
|
||||
CoreSettings = apps.get_model("core", "CoreSettings")
|
||||
key = slugify("DVR Comskip Enabled")
|
||||
CoreSettings.objects.get_or_create(
|
||||
key=key,
|
||||
defaults={"name": "DVR Comskip Enabled", "value": "false"},
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("core", "0015_dvr_templates"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(add_comskip_setting),
|
||||
]
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue