{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/android/issues/707","labels_url":"https://api.github.com/repos/owncloud/android/issues/707/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/android/issues/707/comments","events_url":"https://api.github.com/repos/owncloud/android/issues/707/events","html_url":"https://github.com/owncloud/android/pull/707","id":47818218,"number":707,"title":"Text file preview","user":{"login":"Stoyicker","id":1732935,"avatar_url":"https://avatars.githubusercontent.com/u/1732935?v=3","gravatar_id":"","url":"https://api.github.com/users/Stoyicker","html_url":"https://github.com/Stoyicker","followers_url":"https://api.github.com/users/Stoyicker/followers","following_url":"https://api.github.com/users/Stoyicker/following{/other_user}","gists_url":"https://api.github.com/users/Stoyicker/gists{/gist_id}","starred_url":"https://api.github.com/users/Stoyicker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stoyicker/subscriptions","organizations_url":"https://api.github.com/users/Stoyicker/orgs","repos_url":"https://api.github.com/users/Stoyicker/repos","events_url":"https://api.github.com/users/Stoyicker/events{/privacy}","received_events_url":"https://api.github.com/users/Stoyicker/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/android/labels/0%20-%20Backlog","name":"0 - Backlog","color":"CCCCCC"},{"url":"https://api.github.com/repos/owncloud/android/labels/ReadyToTest","name":"ReadyToTest","color":"5319e7"},{"url":"https://api.github.com/repos/owncloud/android/labels/text","name":"text","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/owncloud/android/milestones/14","html_url":"https://github.com/owncloud/android/milestones/1.8-current","labels_url":"https://api.github.com/repos/owncloud/android/milestones/14/labels","id":1220208,"number":14,"title":"1.8-current","description":"","creator":{"login":"cmonteroluque","id":879976,"avatar_url":"https://avatars.githubusercontent.com/u/879976?v=3","gravatar_id":"","url":"https://api.github.com/users/cmonteroluque","html_url":"https://github.com/cmonteroluque","followers_url":"https://api.github.com/users/cmonteroluque/followers","following_url":"https://api.github.com/users/cmonteroluque/following{/other_user}","gists_url":"https://api.github.com/users/cmonteroluque/gists{/gist_id}","starred_url":"https://api.github.com/users/cmonteroluque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmonteroluque/subscriptions","organizations_url":"https://api.github.com/users/cmonteroluque/orgs","repos_url":"https://api.github.com/users/cmonteroluque/repos","events_url":"https://api.github.com/users/cmonteroluque/events{/privacy}","received_events_url":"https://api.github.com/users/cmonteroluque/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":8,"state":"open","created_at":"2015-07-22T13:27:55Z","updated_at":"2015-08-18T16:35:44Z","due_on":"2015-09-15T04:00:00Z","closed_at":null},"comments":31,"created_at":"2014-11-05T09:58:50Z","updated_at":"2015-08-18T20:28:35Z","closed_at":"2015-08-13T18:25:54Z","pull_request":{"url":"https://api.github.com/repos/owncloud/android/pulls/707","html_url":"https://github.com/owncloud/android/pull/707","diff_url":"https://github.com/owncloud/android/pull/707.diff","patch_url":"https://github.com/owncloud/android/pull/707.patch"},"body":"This PR adds support for previewing text files.\r\n\r\n~~Depends on #661.~~\r\n\r\n<!---\r\n@huboard:{\"order\":5.25}\r\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/owncloud/android/issues/comments/132341087","html_url":"https://github.com/owncloud/android/pull/707#issuecomment-132341087","issue_url":"https://api.github.com/repos/owncloud/android/issues/707","id":132341087,"user":{"login":"Stoyicker","id":1732935,"avatar_url":"https://avatars.githubusercontent.com/u/1732935?v=3","gravatar_id":"","url":"https://api.github.com/users/Stoyicker","html_url":"https://github.com/Stoyicker","followers_url":"https://api.github.com/users/Stoyicker/followers","following_url":"https://api.github.com/users/Stoyicker/following{/other_user}","gists_url":"https://api.github.com/users/Stoyicker/gists{/gist_id}","starred_url":"https://api.github.com/users/Stoyicker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stoyicker/subscriptions","organizations_url":"https://api.github.com/users/Stoyicker/orgs","repos_url":"https://api.github.com/users/Stoyicker/repos","events_url":"https://api.github.com/users/Stoyicker/events{/privacy}","received_events_url":"https://api.github.com/users/Stoyicker/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T20:28:35Z","updated_at":"2015-08-18T20:28:35Z","body":"In summary, I strongly want to keep the \"corrupted\" preview. I'll use an example to try to better explain why. Think of your suggestion: let's imagine that we decide that this functionality only applies to purely plain text files. This is already arguable by the fact that a user downloading, let's say, an HTML (text/html) file, probably expects to be able to see the contents, but instead the functionality would not support it. But even if we decide to go through all 99 text/*something* types and filter in those that are properly readable even if not typed as plain, like text/html, this is inconsistent with the current behaviour of the app.\r\nTake a look at the image previewing procedure: it should be pretty similar (actually the text preview is designed in strict accordance with it). Any file that is considered an image by the app - like, for example, PSD files - will be attempted to preview. However, trying to preview a PSD will result in an \"improper\" preview. Therefore, the same should apply to other types of previews.\r\nMaking a proper fix for this is, in my opinion, an application-level issue, that is independent of this PR; this is, filtering only concrete, fully-qualified mimetypes in all UCs where a file type needs to be identified, this is, by rewriting the is*() methods in OCFile. If this is not seen as an independent problem and we decide to fix it here instead, the behaviour will not beg consistent with other previews."}}