Do not write some tags if there is no value.

This commit is contained in:
Damiano Galassi committed 2016-07-29 09:15:00 +02:00
1 parent d837d60945
commit c050aa991e
1 file changed
+6 -6
+6 -6
View File
@@ -1278,7 +1278,7 @@ static const genreType_t genreType_strings[] = {
MP4TagsSetContentRating(tags, &contentRating); MP4TagsSetContentRating(tags, &contentRating);
if (tagsDict[@"iTunes Country"]) { if (tagsDict[@"iTunes Country"] && [tagsDict[@"iTunes Country"] length]) {
const uint32_t i = [tagsDict[@"iTunes Country"] integerValue]; const uint32_t i = [tagsDict[@"iTunes Country"] integerValue];
MP4TagsSetITunesCountry(tags, &i); MP4TagsSetITunesCountry(tags, &i);
} }
@@ -1286,7 +1286,7 @@ static const genreType_t genreType_strings[] = {
MP4TagsSetITunesCountry(tags, NULL); MP4TagsSetITunesCountry(tags, NULL);
} }
if (tagsDict[@"contentID"]) { if (tagsDict[@"contentID"] && [tagsDict[@"contentID"] length]) {
const uint32_t i = [tagsDict[@"contentID"] integerValue]; const uint32_t i = [tagsDict[@"contentID"] integerValue];
MP4TagsSetContentID(tags, &i); MP4TagsSetContentID(tags, &i);
} }
@@ -1294,7 +1294,7 @@ static const genreType_t genreType_strings[] = {
MP4TagsSetContentID(tags, NULL); MP4TagsSetContentID(tags, NULL);
} }
if (tagsDict[@"genreID"]) { if (tagsDict[@"genreID"] && [tagsDict[@"genreID"] length]) {
const uint32_t i = [tagsDict[@"genreID"] integerValue]; const uint32_t i = [tagsDict[@"genreID"] integerValue];
MP4TagsSetGenreID(tags, &i); MP4TagsSetGenreID(tags, &i);
} }
@@ -1302,7 +1302,7 @@ static const genreType_t genreType_strings[] = {
MP4TagsSetGenreID(tags, NULL); MP4TagsSetGenreID(tags, NULL);
} }
if (tagsDict[@"artistID"]) { if (tagsDict[@"artistID"] && [tagsDict[@"artistID"] length]) {
const uint32_t i = [tagsDict[@"artistID"] integerValue]; const uint32_t i = [tagsDict[@"artistID"] integerValue];
MP4TagsSetArtistID(tags, &i); MP4TagsSetArtistID(tags, &i);
} }
@@ -1310,7 +1310,7 @@ static const genreType_t genreType_strings[] = {
MP4TagsSetArtistID(tags, NULL); MP4TagsSetArtistID(tags, NULL);
} }
if (tagsDict[@"playlistID"]) { if (tagsDict[@"playlistID"] && [tagsDict[@"playlistID"] length]) {
const uint64_t i = [tagsDict[@"playlistID"] integerValue]; const uint64_t i = [tagsDict[@"playlistID"] integerValue];
MP4TagsSetPlaylistID(tags, &i); MP4TagsSetPlaylistID(tags, &i);
} }
@@ -1318,7 +1318,7 @@ static const genreType_t genreType_strings[] = {
MP4TagsSetPlaylistID(tags, NULL); MP4TagsSetPlaylistID(tags, NULL);
} }
if (tagsDict[@"composerID"]) { if (tagsDict[@"composerID"] && [tagsDict[@"composerID"] length]) {
const uint32_t i = [tagsDict[@"composerID"] integerValue]; const uint32_t i = [tagsDict[@"composerID"] integerValue];
MP4TagsSetComposerID(tags, &i); MP4TagsSetComposerID(tags, &i);
} }