-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove all images for a show, using the ImageClass(). #3503
Conversation
p0psicles
commented
Dec 20, 2017
- PR is based on the DEVELOP branch
- Don't send big changes all at once. Split up big PRs into multiple smaller PRs that are easier to manage and review
- Read the contribution guide
@@ -1793,6 +1793,7 @@ def updateShow(self, show=None): | |||
|
|||
# force the update | |||
try: | |||
show_obj.remove_images() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See one line change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Point is, that this is an object oriented approach. As the logic to delete the files in now in the ImageClass, where it should be. To make it more clean, we could even replace some of logic for cleaning up the images after a show delete, using this method.
Ok but as I said it won't work if user only one want to update images and not rescan ALL files. My other PR has an action in mass update that only update images and doesn't rescan all files from disk |
Codecov Report
@@ Coverage Diff @@
## develop #3503 +/- ##
==========================================
- Coverage 32.98% 32.88% -0.1%
==========================================
Files 275 275
Lines 34826 35078 +252
==========================================
+ Hits 11486 11536 +50
- Misses 23340 23542 +202
Continue to review full report at Codecov.
|
What's wrong with rescanning? I thought that was the solution, we agreed on? Just do a force full update right? |
@p0psicles sure but I also want to add an option to only update images. Rescanning a 10 season show with tons of episodes may be wrong if user want only new images. Understood my pov? |
You can use the Image Class for that. Fine if you add it in this Pr. |
@p0psicles ok but I still don't know how to NOT lock the ui when calling a unscheduled task |
Fix incorrect log params Fix incorrect detection of existing path Fix striping characters from fanart
Accidentally pushed to wrong branch. Reverted after. |
@fernandog just port your changes for the massEdit to this pr. Only difference now, compared to your pr. Is that you have to use the command from this PR to remove the images. And after that, you recreate them. |
@p0psicles I cherry-picked and changed code BUT its reading ALL files from disk. I did for only one show with 100 episodes and I got 100 logs like this: as you can see in the code: @location.setter
def location(self, value):
log.debug('{id}: Setter sets location to {location}',
{'id': self.series.indexerid, 'location': value})
self._location = value
self.file_size = os.path.getsize(value) if value and self.is_location_valid(value) else 0 If calls os.path to get size of all files and check if file exists. |
I tested this (also the massupdate) and besides one small error, ALl LGTM. |
@p0psicles did you read my message about it reading all files from disk when doing this image update? |
Yeah commented on it on slack. But I can't reproduce it. But I didn't have any episodes in my shows. So maybe that's why? |