{"action":"created","issue":{"url":"https://api.github.com/repos/telegramdesktop/tdesktop/issues/5338","repository_url":"https://api.github.com/repos/telegramdesktop/tdesktop","labels_url":"https://api.github.com/repos/telegramdesktop/tdesktop/issues/5338/labels{/name}","comments_url":"https://api.github.com/repos/telegramdesktop/tdesktop/issues/5338/comments","events_url":"https://api.github.com/repos/telegramdesktop/tdesktop/issues/5338/events","html_url":"https://github.com/telegramdesktop/tdesktop/pull/5338","id":376439821,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI3NjU2Mjc5","number":5338,"title":"Fixed display of files with 'audio/' MIME in Shared Media.","user":{"login":"23rd","id":4051126,"node_id":"MDQ6VXNlcjQwNTExMjY=","avatar_url":"https://avatars3.githubusercontent.com/u/4051126?v=4","gravatar_id":"","url":"https://api.github.com/users/23rd","html_url":"https://github.com/23rd","followers_url":"https://api.github.com/users/23rd/followers","following_url":"https://api.github.com/users/23rd/following{/other_user}","gists_url":"https://api.github.com/users/23rd/gists{/gist_id}","starred_url":"https://api.github.com/users/23rd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/23rd/subscriptions","organizations_url":"https://api.github.com/users/23rd/orgs","repos_url":"https://api.github.com/users/23rd/repos","events_url":"https://api.github.com/users/23rd/events{/privacy}","received_events_url":"https://api.github.com/users/23rd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-11-01T15:22:19Z","updated_at":"2018-11-15T05:43:33Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/telegramdesktop/tdesktop/pulls/5338","html_url":"https://github.com/telegramdesktop/tdesktop/pull/5338","diff_url":"https://github.com/telegramdesktop/tdesktop/pull/5338.diff","patch_url":"https://github.com/telegramdesktop/tdesktop/pull/5338.patch"},"body":"This PR fixes display of files with \"audio/\" MIME in Shared Media.\r\n  \r\n`DocumentData::isAudioFile()` checks the MIME, which leads to incorrect display of files involved in the audio.\r\nOrdinary playlist files, such as m3u, are perceived by Telegram as playable files. After click on this file, Telegram tries to play it, but gets fail.\r\n  \r\nAs far as I understand, Telegram does not need to check the \"audio/\" MIME at all, since file type is received from the server; even if the mp3 file is without an extension, it will still play perfectly and will be placed in \"Audio files\" category.\r\n\r\nSo, we have to remove `_mimeString.startsWith(qstr(\"audio/\"), Qt::CaseInsensitive);`, but then `isAudioFile()` will return true only in one case, when `isSong()` is true. And we can safely combine `isSong()` and `isAudioFile()` in single method.\r\n\r\nIf you think these changes should be separated into two pull requests, I will do it.\r\n\r\nDespite the fact that many methods are replaced here, this pull request does not break anything, all the displays in the history, dialogs and Shared Media work correctly.\r\n\r\n\r\nBefore patch:\r\n![image](https://user-images.githubusercontent.com/4051126/47860381-725f9380-de01-11e8-80a4-4a3df06818e2.png)\r\n\r\nAfter patch:\r\n![image](https://user-images.githubusercontent.com/4051126/47860638-0df10400-de02-11e8-8dbd-3892b245ca2c.png)\r\n"},"comment":{"url":"https://api.github.com/repos/telegramdesktop/tdesktop/issues/comments/438924895","html_url":"https://github.com/telegramdesktop/tdesktop/pull/5338#issuecomment-438924895","issue_url":"https://api.github.com/repos/telegramdesktop/tdesktop/issues/5338","id":438924895,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODkyNDg5NQ==","user":{"login":"john-preston","id":17900494,"node_id":"MDQ6VXNlcjE3OTAwNDk0","avatar_url":"https://avatars1.githubusercontent.com/u/17900494?v=4","gravatar_id":"","url":"https://api.github.com/users/john-preston","html_url":"https://github.com/john-preston","followers_url":"https://api.github.com/users/john-preston/followers","following_url":"https://api.github.com/users/john-preston/following{/other_user}","gists_url":"https://api.github.com/users/john-preston/gists{/gist_id}","starred_url":"https://api.github.com/users/john-preston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/john-preston/subscriptions","organizations_url":"https://api.github.com/users/john-preston/orgs","repos_url":"https://api.github.com/users/john-preston/repos","events_url":"https://api.github.com/users/john-preston/events{/privacy}","received_events_url":"https://api.github.com/users/john-preston/received_events","type":"User","site_admin":false},"created_at":"2018-11-15T05:43:33Z","updated_at":"2018-11-15T05:43:33Z","author_association":"MEMBER","body":"Thanks!"}}
{"actor":{"display_login":"john-preston"}}