{"action":"created","comment":{"url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/comments/76523132","id":76523132,"diff_hunk":"@@ -63,64 +53,69 @@ static_assert(sizeof(wchar_t) == sizeof(QChar), \"wchar_t is not the same size th\n \n namespace mixxx {\n \n-namespace {\n+namespace taglib {\n \n-const QString kFileTypeAIFF(\"aiff\");\n-const QString kFileTypeFLAC(\"flac\");\n-const QString kFileTypeMP3(\"mp3\");\n-const QString kFileTypeMP4(\"mp4\");\n-const QString kFileTypeOggVorbis(\"ogg\");\n-const QString kFileTypeOggOpus(\"opus\");\n-const QString kFileTypeWAV(\"wav\");\n-const QString kFileTypeWavPack(\"wv\");\n+QDebug operator<<(QDebug debug, FileType fileType) {\n+    return debug << static_cast<std::underlying_type<FileType>::type>(fileType);\n+}\n \n-// Preferred picture types for cover art sorted by priority\n-const std::array<TagLib::ID3v2::AttachedPictureFrame::Type, 4> kPreferredID3v2PictureTypes = {\n-        TagLib::ID3v2::AttachedPictureFrame::FrontCover, // Front cover image of the album\n-        TagLib::ID3v2::AttachedPictureFrame::Media, // Image from the album itself\n-        TagLib::ID3v2::AttachedPictureFrame::Illustration, // Illustration related to the track\n-        TagLib::ID3v2::AttachedPictureFrame::Other\n-};\n-const std::array<TagLib::FLAC::Picture::Type, 4> kPreferredVorbisCommentPictureTypes = {\n-        TagLib::FLAC::Picture::FrontCover, // Front cover image of the album\n-        TagLib::FLAC::Picture::Media, // Image from the album itself\n-        TagLib::FLAC::Picture::Illustration, // Illustration related to the track\n-        TagLib::FLAC::Picture::Other\n-};\n+bool hasID3v1Tag(::TagLib::MPEG::File& file) {\n+#if (TAGLIB_HAS_TAG_CHECK)\n+    return file.hasID3v1Tag();\n+#else\n+    return nullptr != file.ID3v1Tag();\n+#endif\n+}\n \n-inline bool hasID3v2Tag(TagLib::MPEG::File& file) {\n+bool hasID3v2Tag(::TagLib::MPEG::File& file) {\n #if (TAGLIB_HAS_TAG_CHECK)\n     return file.hasID3v2Tag();\n #else\n     return nullptr != file.ID3v2Tag();\n #endif\n }\n \n-inline bool hasAPETag(TagLib::MPEG::File& file) {\n+bool hasAPETag(::TagLib::MPEG::File& file) {\n #if (TAGLIB_HAS_TAG_CHECK)\n     return file.hasAPETag();\n #else\n     return nullptr != file.APETag();\n #endif\n }\n \n-inline bool hasID3v2Tag(TagLib::FLAC::File& file) {\n+namespace {\n+\n+// Preferred picture types for cover art sorted by priority\n+const std::array<::TagLib::ID3v2::AttachedPictureFrame::Type, 4> kPreferredID3v2PictureTypes = {\n+        ::TagLib::ID3v2::AttachedPictureFrame::FrontCover, // Front cover image of the album","path":"src/track/trackmetadatataglib.cpp","position":84,"original_position":84,"commit_id":"c0be58a0f541f274599f28c2bb68826ba5280b4e","original_commit_id":"c0be58a0f541f274599f28c2bb68826ba5280b4e","user":{"login":"daschuer","id":1777442,"avatar_url":"https://avatars.githubusercontent.com/u/1777442?v=3","gravatar_id":"","url":"https://api.github.com/users/daschuer","html_url":"https://github.com/daschuer","followers_url":"https://api.github.com/users/daschuer/followers","following_url":"https://api.github.com/users/daschuer/following{/other_user}","gists_url":"https://api.github.com/users/daschuer/gists{/gist_id}","starred_url":"https://api.github.com/users/daschuer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daschuer/subscriptions","organizations_url":"https://api.github.com/users/daschuer/orgs","repos_url":"https://api.github.com/users/daschuer/repos","events_url":"https://api.github.com/users/daschuer/events{/privacy}","received_events_url":"https://api.github.com/users/daschuer/received_events","type":"User","site_admin":false},"body":"The leading :: in front of TagLib should be redundant. \r\n\r\nIt makes the code harder to read for my eyes. \r\nIt should be clear without it that TagLib is in the global name space. \r\nWe do not use it for other global calls in Mixxx. Is this a good practice we should introduce? \r\n","created_at":"2016-08-27T22:22:25Z","updated_at":"2016-08-27T22:22:25Z","html_url":"https://github.com/mixxxdj/mixxx/pull/997#discussion_r76523132","pull_request_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/997","_links":{"self":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/comments/76523132"},"html":{"href":"https://github.com/mixxxdj/mixxx/pull/997#discussion_r76523132"},"pull_request":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/997"}}},"pull_request":{"url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/997","id":82988400,"html_url":"https://github.com/mixxxdj/mixxx/pull/997","diff_url":"https://github.com/mixxxdj/mixxx/pull/997.diff","patch_url":"https://github.com/mixxxdj/mixxx/pull/997.patch","issue_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/997","number":997,"state":"open","locked":false,"title":"TagLib: Don't (re-)add legacy ID3v1 tag to MP3 files","user":{"login":"uklotzde","id":1474154,"avatar_url":"https://avatars.githubusercontent.com/u/1474154?v=3","gravatar_id":"","url":"https://api.github.com/users/uklotzde","html_url":"https://github.com/uklotzde","followers_url":"https://api.github.com/users/uklotzde/followers","following_url":"https://api.github.com/users/uklotzde/following{/other_user}","gists_url":"https://api.github.com/users/uklotzde/gists{/gist_id}","starred_url":"https://api.github.com/users/uklotzde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uklotzde/subscriptions","organizations_url":"https://api.github.com/users/uklotzde/orgs","repos_url":"https://api.github.com/users/uklotzde/repos","events_url":"https://api.github.com/users/uklotzde/events{/privacy}","received_events_url":"https://api.github.com/users/uklotzde/received_events","type":"User","site_admin":false},"body":"This PR fixes an unwanted behavior of TagLib when saving tags of MPEG files in Mixxx. First I added a new regression test that fails before actually fixing the unwanted behavior.\r\n\r\nIf you invoke the generic implementation TagLib::File::save() ID3v1 tags will be added, regardless if the file contains ID3v1 tags or not. If a file contains only ID3v2 or APE tags, but no ID3v1 tags you usually don't want to add them again! This can be accomplished by using the specialized variants of TagLib::MPEG::File::save() that provide fine-grained control about which tags are saved.","created_at":"2016-08-27T13:47:12Z","updated_at":"2016-08-27T22:22:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"616f124087289914bd2c72116feda2c5fda1d1a9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/997/commits","review_comments_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/997/comments","review_comment_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/997/comments","statuses_url":"https://api.github.com/repos/mixxxdj/mixxx/statuses/c0be58a0f541f274599f28c2bb68826ba5280b4e","head":{"label":"uklotzde:bugfix_taglib_mpegfile_write","ref":"bugfix_taglib_mpegfile_write","sha":"c0be58a0f541f274599f28c2bb68826ba5280b4e","user":{"login":"uklotzde","id":1474154,"avatar_url":"https://avatars.githubusercontent.com/u/1474154?v=3","gravatar_id":"","url":"https://api.github.com/users/uklotzde","html_url":"https://github.com/uklotzde","followers_url":"https://api.github.com/users/uklotzde/followers","following_url":"https://api.github.com/users/uklotzde/following{/other_user}","gists_url":"https://api.github.com/users/uklotzde/gists{/gist_id}","starred_url":"https://api.github.com/users/uklotzde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uklotzde/subscriptions","organizations_url":"https://api.github.com/users/uklotzde/orgs","repos_url":"https://api.github.com/users/uklotzde/repos","events_url":"https://api.github.com/users/uklotzde/events{/privacy}","received_events_url":"https://api.github.com/users/uklotzde/received_events","type":"User","site_admin":false},"repo":{"id":11108787,"name":"mixxx","full_name":"uklotzde/mixxx","owner":{"login":"uklotzde","id":1474154,"avatar_url":"https://avatars.githubusercontent.com/u/1474154?v=3","gravatar_id":"","url":"https://api.github.com/users/uklotzde","html_url":"https://github.com/uklotzde","followers_url":"https://api.github.com/users/uklotzde/followers","following_url":"https://api.github.com/users/uklotzde/following{/other_user}","gists_url":"https://api.github.com/users/uklotzde/gists{/gist_id}","starred_url":"https://api.github.com/users/uklotzde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uklotzde/subscriptions","organizations_url":"https://api.github.com/users/uklotzde/orgs","repos_url":"https://api.github.com/users/uklotzde/repos","events_url":"https://api.github.com/users/uklotzde/events{/privacy}","received_events_url":"https://api.github.com/users/uklotzde/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/uklotzde/mixxx","description":"Mixxx is Free DJ software that gives you everything you need to perform live mixes.","fork":true,"url":"https://api.github.com/repos/uklotzde/mixxx","forks_url":"https://api.github.com/repos/uklotzde/mixxx/forks","keys_url":"https://api.github.com/repos/uklotzde/mixxx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uklotzde/mixxx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uklotzde/mixxx/teams","hooks_url":"https://api.github.com/repos/uklotzde/mixxx/hooks","issue_events_url":"https://api.github.com/repos/uklotzde/mixxx/issues/events{/number}","events_url":"https://api.github.com/repos/uklotzde/mixxx/events","assignees_url":"https://api.github.com/repos/uklotzde/mixxx/assignees{/user}","branches_url":"https://api.github.com/repos/uklotzde/mixxx/branches{/branch}","tags_url":"https://api.github.com/repos/uklotzde/mixxx/tags","blobs_url":"https://api.github.com/repos/uklotzde/mixxx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uklotzde/mixxx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uklotzde/mixxx/git/refs{/sha}","trees_url":"https://api.github.com/repos/uklotzde/mixxx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uklotzde/mixxx/statuses/{sha}","languages_url":"https://api.github.com/repos/uklotzde/mixxx/languages","stargazers_url":"https://api.github.com/repos/uklotzde/mixxx/stargazers","contributors_url":"https://api.github.com/repos/uklotzde/mixxx/contributors","subscribers_url":"https://api.github.com/repos/uklotzde/mixxx/subscribers","subscription_url":"https://api.github.com/repos/uklotzde/mixxx/subscription","commits_url":"https://api.github.com/repos/uklotzde/mixxx/commits{/sha}","git_commits_url":"https://api.github.com/repos/uklotzde/mixxx/git/commits{/sha}","comments_url":"https://api.github.com/repos/uklotzde/mixxx/comments{/number}","issue_comment_url":"https://api.github.com/repos/uklotzde/mixxx/issues/comments{/number}","contents_url":"https://api.github.com/repos/uklotzde/mixxx/contents/{+path}","compare_url":"https://api.github.com/repos/uklotzde/mixxx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uklotzde/mixxx/merges","archive_url":"https://api.github.com/repos/uklotzde/mixxx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uklotzde/mixxx/downloads","issues_url":"https://api.github.com/repos/uklotzde/mixxx/issues{/number}","pulls_url":"https://api.github.com/repos/uklotzde/mixxx/pulls{/number}","milestones_url":"https://api.github.com/repos/uklotzde/mixxx/milestones{/number}","notifications_url":"https://api.github.com/repos/uklotzde/mixxx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uklotzde/mixxx/labels{/name}","releases_url":"https://api.github.com/repos/uklotzde/mixxx/releases{/id}","deployments_url":"https://api.github.com/repos/uklotzde/mixxx/deployments","created_at":"2013-07-01T22:22:18Z","updated_at":"2016-07-17T16:56:58Z","pushed_at":"2016-08-24T06:11:21Z","git_url":"git://github.com/uklotzde/mixxx.git","ssh_url":"git@github.com:uklotzde/mixxx.git","clone_url":"https://github.com/uklotzde/mixxx.git","svn_url":"https://github.com/uklotzde/mixxx","homepage":"http://mixxx.org","size":257526,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mixxxdj:master","ref":"master","sha":"068e34e4fe395e229695cff040cd01d554f33745","user":{"login":"mixxxdj","id":1743769,"avatar_url":"https://avatars.githubusercontent.com/u/1743769?v=3","gravatar_id":"","url":"https://api.github.com/users/mixxxdj","html_url":"https://github.com/mixxxdj","followers_url":"https://api.github.com/users/mixxxdj/followers","following_url":"https://api.github.com/users/mixxxdj/following{/other_user}","gists_url":"https://api.github.com/users/mixxxdj/gists{/gist_id}","starred_url":"https://api.github.com/users/mixxxdj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixxxdj/subscriptions","organizations_url":"https://api.github.com/users/mixxxdj/orgs","repos_url":"https://api.github.com/users/mixxxdj/repos","events_url":"https://api.github.com/users/mixxxdj/events{/privacy}","received_events_url":"https://api.github.com/users/mixxxdj/received_events","type":"Organization","site_admin":false},"repo":{"id":10126031,"name":"mixxx","full_name":"mixxxdj/mixxx","owner":{"login":"mixxxdj","id":1743769,"avatar_url":"https://avatars.githubusercontent.com/u/1743769?v=3","gravatar_id":"","url":"https://api.github.com/users/mixxxdj","html_url":"https://github.com/mixxxdj","followers_url":"https://api.github.com/users/mixxxdj/followers","following_url":"https://api.github.com/users/mixxxdj/following{/other_user}","gists_url":"https://api.github.com/users/mixxxdj/gists{/gist_id}","starred_url":"https://api.github.com/users/mixxxdj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixxxdj/subscriptions","organizations_url":"https://api.github.com/users/mixxxdj/orgs","repos_url":"https://api.github.com/users/mixxxdj/repos","events_url":"https://api.github.com/users/mixxxdj/events{/privacy}","received_events_url":"https://api.github.com/users/mixxxdj/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mixxxdj/mixxx","description":"Mixxx is Free DJ software that gives you everything you need to perform live mixes.","fork":false,"url":"https://api.github.com/repos/mixxxdj/mixxx","forks_url":"https://api.github.com/repos/mixxxdj/mixxx/forks","keys_url":"https://api.github.com/repos/mixxxdj/mixxx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mixxxdj/mixxx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mixxxdj/mixxx/teams","hooks_url":"https://api.github.com/repos/mixxxdj/mixxx/hooks","issue_events_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/events{/number}","events_url":"https://api.github.com/repos/mixxxdj/mixxx/events","assignees_url":"https://api.github.com/repos/mixxxdj/mixxx/assignees{/user}","branches_url":"https://api.github.com/repos/mixxxdj/mixxx/branches{/branch}","tags_url":"https://api.github.com/repos/mixxxdj/mixxx/tags","blobs_url":"https://api.github.com/repos/mixxxdj/mixxx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mixxxdj/mixxx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mixxxdj/mixxx/git/refs{/sha}","trees_url":"https://api.github.com/repos/mixxxdj/mixxx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mixxxdj/mixxx/statuses/{sha}","languages_url":"https://api.github.com/repos/mixxxdj/mixxx/languages","stargazers_url":"https://api.github.com/repos/mixxxdj/mixxx/stargazers","contributors_url":"https://api.github.com/repos/mixxxdj/mixxx/contributors","subscribers_url":"https://api.github.com/repos/mixxxdj/mixxx/subscribers","subscription_url":"https://api.github.com/repos/mixxxdj/mixxx/subscription","commits_url":"https://api.github.com/repos/mixxxdj/mixxx/commits{/sha}","git_commits_url":"https://api.github.com/repos/mixxxdj/mixxx/git/commits{/sha}","comments_url":"https://api.github.com/repos/mixxxdj/mixxx/comments{/number}","issue_comment_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/comments{/number}","contents_url":"https://api.github.com/repos/mixxxdj/mixxx/contents/{+path}","compare_url":"https://api.github.com/repos/mixxxdj/mixxx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mixxxdj/mixxx/merges","archive_url":"https://api.github.com/repos/mixxxdj/mixxx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mixxxdj/mixxx/downloads","issues_url":"https://api.github.com/repos/mixxxdj/mixxx/issues{/number}","pulls_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls{/number}","milestones_url":"https://api.github.com/repos/mixxxdj/mixxx/milestones{/number}","notifications_url":"https://api.github.com/repos/mixxxdj/mixxx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mixxxdj/mixxx/labels{/name}","releases_url":"https://api.github.com/repos/mixxxdj/mixxx/releases{/id}","deployments_url":"https://api.github.com/repos/mixxxdj/mixxx/deployments","created_at":"2013-05-17T15:14:38Z","updated_at":"2016-08-27T04:21:09Z","pushed_at":"2016-08-27T20:55:34Z","git_url":"git://github.com/mixxxdj/mixxx.git","ssh_url":"git@github.com:mixxxdj/mixxx.git","clone_url":"https://github.com/mixxxdj/mixxx.git","svn_url":"https://github.com/mixxxdj/mixxx","homepage":"http://mixxx.org","size":275777,"stargazers_count":578,"watchers_count":578,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":346,"mirror_url":null,"open_issues_count":67,"forks":346,"open_issues":67,"watchers":578,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/997"},"html":{"href":"https://github.com/mixxxdj/mixxx/pull/997"},"issue":{"href":"https://api.github.com/repos/mixxxdj/mixxx/issues/997"},"comments":{"href":"https://api.github.com/repos/mixxxdj/mixxx/issues/997/comments"},"review_comments":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/997/comments"},"review_comment":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/997/commits"},"statuses":{"href":"https://api.github.com/repos/mixxxdj/mixxx/statuses/c0be58a0f541f274599f28c2bb68826ba5280b4e"}}}}
{"actor":{"display_login":"daschuer"}}