diff --git a/python_apps/media-monitor2/media/monitor/listeners.py b/python_apps/media-monitor2/media/monitor/listeners.py index d82bb4f88..134f7db8c 100644 --- a/python_apps/media-monitor2/media/monitor/listeners.py +++ b/python_apps/media-monitor2/media/monitor/listeners.py @@ -6,6 +6,25 @@ import media.monitor.pure as mmp from media.monitor.pure import IncludeOnly from media.monitor.events import OrganizeFile, NewFile, DeleteFile +# We attempt to document a list of all special cases and hacks that the +# following classes should be able to handle. +# TODO : implement all of the following special cases +# - Recursive directories being added to organized dirs are not handled +# properly as they only send a request for the dir and not for every file. Also +# more hacks are needed to check that the directory finished moving/copying? +# +# - In the case when a 'watched' directory's subdirectory is delete we should +# send a special request telling ApiController to delete a whole dir. This is +# done becasue pyinotify will not send an individual file delete event for +# every file in that directory +# +# - Special move events are required whenever a file is moved from a 'watched' +# directory into another 'watched' directory (or subdirectory). In this case we +# must identify the file by its md5 signature instead of it's filepath like we +# usually do. Maybe it's best to always identify a file based on its md5 +# signature?. Of course that's not possible for some modification events +# because the md5 signature will change... + class BaseListener(object): def my_init(self, signal): diff --git a/python_apps/media-monitor2/media/monitor/watchersyncer.py b/python_apps/media-monitor2/media/monitor/watchersyncer.py index 97c1c7800..eab6cc129 100644 --- a/python_apps/media-monitor2/media/monitor/watchersyncer.py +++ b/python_apps/media-monitor2/media/monitor/watchersyncer.py @@ -24,7 +24,11 @@ class RequestSync(threading.Thread,Loggable): def run(self): # TODO : implement proper request sending self.logger.info("launching request with %d items." % len(self.requests)) - #self.apiclient.update_media_metadata( + # Note that we must attach the appropriate mode to every response. Also + # Not forget to attach the 'is_record' to any requests that are related + # to recorded shows + # A simplistic request would like: + # self.apiclient.send_media_monitor_requests(requests) self.watcher.flag_done() class TimeoutWatcher(threading.Thread,Loggable): diff --git a/python_apps/media-monitor2/tests/api_client.py b/python_apps/media-monitor2/tests/api_client.py index af574b12c..c18d638f7 100644 --- a/python_apps/media-monitor2/tests/api_client.py +++ b/python_apps/media-monitor2/tests/api_client.py @@ -1,4 +1,3 @@ - # -*- coding: utf-8 -*- import unittest import os