Skip to content

Commit

Permalink
increase cached title length to 200 chars, ensure title is never set …
Browse files Browse the repository at this point in the history
…over 200 chars, resolves #518 (related to #515)
  • Loading branch information
meeb committed Jul 17, 2024
1 parent 99e6280 commit 69a824e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
28 changes: 28 additions & 0 deletions tubesync/sync/migrations/0024_auto_20240717_1535.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 3.2.25 on 2024-07-17 15:35

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('sync', '0023_media_duration_filter'),
]

operations = [
migrations.AlterField(
model_name='media',
name='manual_skip',
field=models.BooleanField(db_index=True, default=False, help_text='Media marked as "skipped", won\'t be downloaded', verbose_name='manual_skip'),
),
migrations.AlterField(
model_name='media',
name='title',
field=models.CharField(blank=True, default='', help_text='Video title', max_length=200, verbose_name='title'),
),
migrations.AlterField(
model_name='source',
name='filter_text',
field=models.CharField(blank=True, default='', help_text='Regex compatible filter string for video titles', max_length=200, verbose_name='filter string'),
),
]
2 changes: 1 addition & 1 deletion tubesync/sync/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ class Media(models.Model):
)
title = models.CharField(
_('title'),
max_length=100,
max_length=200,
blank=True,
null=False,
default='',
Expand Down
2 changes: 1 addition & 1 deletion tubesync/sync/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def download_media_metadata(media_id):

# Store title in DB so it's fast to access
if media.metadata_title:
media.title = media.metadata_title
media.title = media.metadata_title[:200]

# Store duration in DB so it's fast to access
if media.metadata_duration:
Expand Down

0 comments on commit 69a824e

Please sign in to comment.