{"action":"created","issue":{"url":"https://api.github.com/repos/xbmc/xbmc/issues/11546","repository_url":"https://api.github.com/repos/xbmc/xbmc","labels_url":"https://api.github.com/repos/xbmc/xbmc/issues/11546/labels{/name}","comments_url":"https://api.github.com/repos/xbmc/xbmc/issues/11546/comments","events_url":"https://api.github.com/repos/xbmc/xbmc/issues/11546/events","html_url":"https://github.com/xbmc/xbmc/pull/11546","id":203206249,"number":11546,"title":"ADD: \"Clean thumbnails\" functionality","user":{"login":"Razzeee","id":5943908,"avatar_url":"https://avatars.githubusercontent.com/u/5943908?v=3","gravatar_id":"","url":"https://api.github.com/users/Razzeee","html_url":"https://github.com/Razzeee","followers_url":"https://api.github.com/users/Razzeee/followers","following_url":"https://api.github.com/users/Razzeee/following{/other_user}","gists_url":"https://api.github.com/users/Razzeee/gists{/gist_id}","starred_url":"https://api.github.com/users/Razzeee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Razzeee/subscriptions","organizations_url":"https://api.github.com/users/Razzeee/orgs","repos_url":"https://api.github.com/users/Razzeee/repos","events_url":"https://api.github.com/users/Razzeee/events{/privacy}","received_events_url":"https://api.github.com/users/Razzeee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-01-25T19:58:36Z","updated_at":"2017-01-26T19:16:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/xbmc/xbmc/pulls/11546","html_url":"https://github.com/xbmc/xbmc/pull/11546","diff_url":"https://github.com/xbmc/xbmc/pull/11546.diff","patch_url":"https://github.com/xbmc/xbmc/pull/11546.patch"},"body":"<!--- Provide a general summary of your change in the Title above -->\r\n\r\n## Description\r\n<!--- Describe your change in detail -->\r\nPicked from spmc https://github.com/koying/SPMC/commit/3f255975618e697d018d74feb2e19e9624c72be2#diff-92b91a5c902936f6e9a03f26b054d7d6\r\n\r\nHaven't really looked at the code yet.\r\n\r\nI made some small string changes and moved it into a category that makes more sense, I think.\r\n\r\n## Motivation and Context\r\n<!--- Why is this change required? What problem does it solve? -->\r\n<!--- If it fixes an open issue, please link to the issue here -->\r\n\r\n## How Has This Been Tested?\r\n<!--- Please describe in detail how you tested your change -->\r\n<!--- Include details of your testing environment, and the tests you ran to -->\r\n<!--- see how your change affects other areas of the code, etc -->\r\nCompiles and seem to work fine, I just don't have any thumbs on my dev pc right now. But I think it's in spmc for a while now already.\r\n\r\n\r\n## Screenshots (if appropriate):\r\n![image](https://cloud.githubusercontent.com/assets/5943908/22306705/7e6bb69e-e340-11e6-86c8-30d75e509c07.png)\r\n\r\n\r\n## Types of change\r\n<!--- What type of change does your code introduce? Put an `x` in all the boxes that apply like this: [X] -->\r\n- [ ] Bug fix (non-breaking change which fixes an issue)\r\n- [x] New feature (non-breaking change which adds functionality)\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to change)\r\n\r\n## Checklist:\r\n<!--- Go over all the following points, and put an `x` in all the boxes that apply like this: [X] -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [x] My code follows the [Code guidelines](https://codedocs.xyz/xbmc/xbmc/code_guidelines.html) of this project \r\n- [ ] My change requires a change to the documentation, either Doxygen or wiki\r\n- [ ] I have updated the documentation accordingly\r\n- [x] I have read the [CONTRIBUTING](https://github.com/xbmc/xbmc/blob/master/CONTRIBUTING.md) document\r\n- [ ] I have added tests to cover my change\r\n- [x] All new and existing tests passed\r\n"},"comment":{"url":"https://api.github.com/repos/xbmc/xbmc/issues/comments/275483596","html_url":"https://github.com/xbmc/xbmc/pull/11546#issuecomment-275483596","issue_url":"https://api.github.com/repos/xbmc/xbmc/issues/11546","id":275483596,"user":{"login":"MilhouseVH","id":805038,"avatar_url":"https://avatars.githubusercontent.com/u/805038?v=3","gravatar_id":"","url":"https://api.github.com/users/MilhouseVH","html_url":"https://github.com/MilhouseVH","followers_url":"https://api.github.com/users/MilhouseVH/followers","following_url":"https://api.github.com/users/MilhouseVH/following{/other_user}","gists_url":"https://api.github.com/users/MilhouseVH/gists{/gist_id}","starred_url":"https://api.github.com/users/MilhouseVH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MilhouseVH/subscriptions","organizations_url":"https://api.github.com/users/MilhouseVH/orgs","repos_url":"https://api.github.com/users/MilhouseVH/repos","events_url":"https://api.github.com/users/MilhouseVH/events{/privacy}","received_events_url":"https://api.github.com/users/MilhouseVH/received_events","type":"User","site_admin":false},"created_at":"2017-01-26T19:16:00Z","updated_at":"2017-01-26T19:16:00Z","body":"As this will only clean thumbnails that don't have a row in the TexturesXX.db the likelihood is that this will remove/clean very few - if any - thumbnails.\r\n\r\nUnless the rows are removed from TexturesXX.db (for example, during a clean library, or when uninstalling an add-on) this PR will unfortunately have very little impact (and may lead to false expectations among users, although the help text is relatively clear). However if Kodi is removing the rows from the database it might as well remove the files also, again leaving little for this PR to do.\r\n\r\nAnd even with this PR, and Kodi removing rows and files from the texture cache during a clean library etc., it still leaves the problem of centralised metadata: using a shared database, you run a clean library on clientA which removes the thumbnail row from it's local TexturesXX.db (and might even remove the corresponding thumbnail from `special://thumbnails`). Next, you run \"Clean thumbnails\" on clientB and it will remove nothing as all the thumbnail rows of the just cleaned movies are still present in the local TexturesXX.db on this client - the only place these thumbnails are no longer present (as far as this client is concerned) is in the shared database (ie. artwork urls).\r\n\r\nSo while this PR looks fine for deleting \"dangling\" thumbnails that's all it does and I'm not sure this is really a problem worth solving with a new GUI setting (it will cause confusion, while most users should have hardly any dangling thumbnails, and those they have are unlikely to be a problem other than a minimal amount of bloat). If dangling thumbnails is a problem worth solving then we should be identifying the cause of the dangling thumbnails and fixing that...\r\n\r\nBy the way, my [texturecache.py](https://github.com/MilhouseVH/texturecache.py) script can identify dangling thumbnails with: `texturecache.py r` - I have 9 such files out of 23619, and all but 1 are 0 bytes in size (the other is 5818 bytes). `texturecache.py R` can be used to remove these dangling files, which is the equivalent of this PR.\r\n\r\nThere's also `texturecache.py X` which will identify rows in the TexturesXX.db database that point at non-existent thumbnail files (`texturecache.py Xd` to remove these rows).\r\n\r\nFinally, `texturecache.py p` will list thumbnails that do not exist in the media library (`texturecache.py P` to \"prune\" and remove these entries). These cached artworks suitable for pruning are often temporary in nature (plugin/add-on related, eg. youtube video thumbnail previews etc.) or related to removed media (movies, tv shows/seasons/episodes, albums/artists/songs, add-ons), and can result in significant bloat if not removed. I've had reports of this removing up to 2GB of unnecessary thumbnail files."}}
{"actor":{"display_login":"MilhouseVH"}}