Repository: pymedusa/Medusa

Issue:
[APP SUBMITTED]: IOError: [Errno 2] No such file or directory: u'/downloads/completed/Westworld.S02E08.1080p.WEB.H264-DEFLATE-Rakuv/.@__thumb/adefault9ff43b5ec4d34ffeaee6a0f5c8773da4.mkv'

### INFO
**Python Version**: `2.7.14 (default, Dec 14 2017, 15:51:29) [GCC 6.4.0]`
**Operating System**: `Linux-4.2.8-x86_64-with`
**Locale**: `None`
**Branch**: [master](../tree/master)
**Database**: `44.11`
**Commit**: pymedusa/Medusa@c65ca2607fae74405dcceaaf8c02f3d29d0313ea
**Link to Log**: https://gist.github.com/ff8b5ae022d29491ae29c06766262d8b
### ERROR
<pre>
2018-06-11 16:12:47 ERROR    POSTPROCESSOR :: [c65ca26] Unable to move file /downloads/completed/Westworld.S02E08.1080p.WEB.H264-DEFLATE-Rakuv/.@__thumb/default9ff43b5ec4d34ffeaee6a0f5c8773da4.mkv to /tv/Westworld/Season 02: IOError(2, 'No such file or directory')
Traceback (most recent call last):
  File "/app/medusa/medusa/post_processor.py", line 1223, in process
    app.MOVE_ASSOCIATED_FILES, app.USE_SUBTITLES and ep_obj.series.subtitles)
  File "/app/medusa/medusa/post_processor.py", line 508, in post_process_action
    action=action, subtitle_action=subtitle_action, subtitles=subtitles)
  File "/app/medusa/medusa/post_processor.py", line 433, in _combined_file_operation
    file_list += self.list_associated_files(file_path, refine=True)
  File "/app/medusa/medusa/post_processor.py", line 208, in list_associated_files
    processed_names += tuple((_f for _f in (self._rar_basename(file_path, files),) if _f))
  File "/app/medusa/medusa/post_processor.py", line 318, in _rar_basename
    for rar in rars:
  File "/app/medusa/medusa/post_processor.py", line 316, in <genexpr>
    rars = (x for x in files if rarfile.is_rarfile(x))
  File "/app/medusa/medusa/init/filesystem.py", line 113, in patched_output
    return handle_output(f(*args, **kwargs))
  File "/app/medusa/ext/rarfile.py", line 404, in is_rarfile
    return _get_rar_version(xfile) > 0
  File "/app/medusa/ext/rarfile.py", line 389, in _get_rar_version
    with XFile(xfile) as fd:
  File "/app/medusa/ext/rarfile.py", line 2401, in __init__
    self._fd = open(xfile, 'rb', bufsize)
IOError: [Errno 2] No such file or directory: u'/downloads/completed/Westworld.S02E08.1080p.WEB.H264-DEFLATE-Rakuv/.@__thumb/adefault9ff43b5ec4d34ffeaee6a0f5c8773da4.mkv'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators



Discussion:
What system are you on? Is that `.@__thumb` a temporary folder?
@medariox According to the web, it's QNAP and these are thumbnail folders.
Yes it’s a QNAP nas.. the OS insists on creating these folders if I access the file system through the admin interface but then Medusa fails to process the folder and leaves it behind in “completed” folder with the above errors..
Yeah, I think we may need to add this folder to the "ignored folders" list built into the post-processor.

Resolving patch:
diff --git a/medusa/process_tv.py b/medusa/process_tv.py
--- a/medusa/process_tv.py
+++ b/medusa/process_tv.py
@@ -30,7 +30,7 @@
 
 class ProcessResult(object):
 
-    IGNORED_FOLDERS = ('@eaDir', '#recycle',)
+    IGNORED_FOLDERS = ('@eaDir', '#recycle', '.@__thumb',)
 
     def __init__(self, path, process_method=None):
 


Test patch: