cc-4105: fixed bug with editing metadata id3v2
This commit is contained in:
parent
0e2d523bf6
commit
ee1491a487
|
@ -91,9 +91,9 @@ class BaseEvent(Loggable):
|
|||
|
||||
class FakePyinotify(object):
|
||||
"""
|
||||
sometimes we must create our own pyinotify like objects to instantiate
|
||||
objects from the classes below whenever we want to turn a single event into
|
||||
multiple events
|
||||
sometimes we must create our own pyinotify like objects to
|
||||
instantiate objects from the classes below whenever we want to turn
|
||||
a single event into multiple events
|
||||
"""
|
||||
def __init__(self, path):
|
||||
self.pathname = path
|
||||
|
|
|
@ -125,14 +125,15 @@ class StoreWatchListener(BaseListener, Loggable, pyinotify.ProcessEvent):
|
|||
def process_IN_MOVED_FROM(self, event):
|
||||
# Is either delete dir or delete file
|
||||
evt = self.process_delete(event)
|
||||
if hasattr(event,'cookie'): EventRegistry.register(evt)
|
||||
# evt can be none whenever event points that a file that would be
|
||||
# ignored by @IncludeOnly
|
||||
if hasattr(event,'cookie') and (evt != None):
|
||||
EventRegistry.register(evt)
|
||||
def process_IN_DELETE(self,event): self.process_delete(event)
|
||||
def process_IN_MOVE_SELF(self, event):
|
||||
if '-unknown-path' in event.pathname:
|
||||
event.pathname = event.pathname.replace('-unknown-path','')
|
||||
self.delete_watch_dir(event)
|
||||
# Capturing modify events is too brittle and error prone
|
||||
# def process_IN_MODIFY(self,event): self.process_modify(event)
|
||||
|
||||
def delete_watch_dir(self, event):
|
||||
e = DeleteDirWatch(event)
|
||||
|
|
|
@ -77,11 +77,12 @@ class Manager(Loggable):
|
|||
"""
|
||||
creates an organizer at new destination path or modifies the old one
|
||||
"""
|
||||
# We avoid creating new instances of organize because of the way it
|
||||
# interacts with pydispatch. We must be careful to never have more than
|
||||
# one instance of OrganizeListener but this is not so easy. (The
|
||||
# singleton hack in Organizer) doesn't work. This is the only thing
|
||||
# that seems to work.
|
||||
# TODO : find a proper fix for the following hack
|
||||
# We avoid creating new instances of organize because of the way
|
||||
# it interacts with pydispatch. We must be careful to never have
|
||||
# more than one instance of OrganizeListener but this is not so
|
||||
# easy. (The singleton hack in Organizer) doesn't work. This is
|
||||
# the only thing that seems to work.
|
||||
if self.organize['organizer']:
|
||||
o = self.organize['organizer']
|
||||
o.channel = self.organize_channel
|
||||
|
|
|
@ -7,11 +7,12 @@ from media.monitor.exceptions import BadSongFile
|
|||
|
||||
class Organizer(ReportHandler,Loggable):
|
||||
"""
|
||||
Organizer is responsible to to listening to OrganizeListener events and
|
||||
committing the appropriate changes to the filesystem. It does not in any
|
||||
interact with WatchSyncer's even when the the WatchSyncer is a "storage
|
||||
directory". The "storage" directory picks up all of its events through
|
||||
pyinotify. (These events are fed to it through StoreWatchListener)
|
||||
Organizer is responsible to to listening to OrganizeListener events
|
||||
and committing the appropriate changes to the filesystem. It does
|
||||
not in any interact with WatchSyncer's even when the the WatchSyncer
|
||||
is a "storage directory". The "storage" directory picks up all of
|
||||
its events through pyinotify. (These events are fed to it through
|
||||
StoreWatchListener)
|
||||
"""
|
||||
|
||||
_instance = None
|
||||
|
|
Loading…
Reference in New Issue