From cebdf1b62112d69c2948389292fa6d69e10bdbcf Mon Sep 17 00:00:00 2001 From: tcely Date: Thu, 12 Jun 2025 13:32:03 -0400 Subject: [PATCH] Clean up filtering of empty lines --- .../sync/management/commands/create-tvshow-nfo.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tubesync/sync/management/commands/create-tvshow-nfo.py b/tubesync/sync/management/commands/create-tvshow-nfo.py index 3691b259..0295b66d 100644 --- a/tubesync/sync/management/commands/create-tvshow-nfo.py +++ b/tubesync/sync/management/commands/create-tvshow-nfo.py @@ -1,6 +1,5 @@ import base64 import binascii -import os from common.logger import log from django.utils.translation import gettext_lazy as _ from sync.models import Source @@ -81,14 +80,15 @@ class Command(BaseCommand): {channel_id or ''} ''' - content = os.linesep.join(filter( + tfmt = '<{t}>' + content = ''.join(filter( lambda s: s.replace( - '', '', + tfmt.format(t='studio'), '', 1, ).replace( - '', '', - ).lstrip(' '), - content.splitlines(), - )) + os.linesep + tfmt.format(t='tag'), '', 1, + ).lstrip(), + content.splitlines(keepends=True), + )) log.debug( f'Writing new content to: {nfo_path}', )