From af0aae3de4ef85513de39201a0e6d94310a92f5f Mon Sep 17 00:00:00 2001 From: tcely Date: Thu, 16 Jan 2025 01:18:20 -0500 Subject: [PATCH 1/2] Don't write 'None' in default rating It's better to not have a rating than to create parsing problems. An example of what is avoided: ``` None 16781 ``` --- tubesync/sync/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tubesync/sync/models.py b/tubesync/sync/models.py index 14ce4cf0..59d9e6d8 100644 --- a/tubesync/sync/models.py +++ b/tubesync/sync/models.py @@ -1426,7 +1426,8 @@ class Media(models.Model): rating.tail = '\n ' ratings = nfo.makeelement('ratings', {}) ratings.text = '\n ' - ratings.append(rating) + if self.rating is not None: + ratings.append(rating) ratings.tail = '\n ' nfo.append(ratings) # plot = media metadata description From 57417915bf9357c170ba5748dde2d812c61dad4a Mon Sep 17 00:00:00 2001 From: tcely Date: Thu, 16 Jan 2025 01:27:41 -0500 Subject: [PATCH 2/2] lowercase the true value I doubt it's unsupported by any parser, but every example uses lowercase for this, we may as well also. --- tubesync/sync/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tubesync/sync/models.py b/tubesync/sync/models.py index 59d9e6d8..44a94454 100644 --- a/tubesync/sync/models.py +++ b/tubesync/sync/models.py @@ -1418,7 +1418,7 @@ class Media(models.Model): rating_attrs = OrderedDict() rating_attrs['name'] = 'youtube' rating_attrs['max'] = '5' - rating_attrs['default'] = 'True' + rating_attrs['default'] = 'true' rating = nfo.makeelement('rating', rating_attrs) rating.text = '\n ' rating.append(value)