Changeset 403
- Timestamp:
- 15/08/08 15:56:49 (2 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
-
INSTALL (modified) (1 diff)
-
Makefile (modified) (1 diff)
-
Monitor_Linux.pm (modified) (1 diff)
-
Monitor_Windows.pm (added)
-
Plugin.pm (modified) (7 diffs)
-
install.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/INSTALL
r358 r403 39 39 @@HOWTO install@@ 40 40 41 42 WINDOWS SPECIALS 43 Must be running the ActiveState perl version (ie run slimserver.pl directly). 44 41 45 Copyright © Stuart Hickinbottom 2007-2008 -
trunk/Makefile
r402 r403 21 21 22 22 VERSION=1.0b5 23 PERLSOURCE=Plugin.pm Settings.pm Monitor_Linux.pm 23 PERLSOURCE=Plugin.pm Settings.pm Monitor_Linux.pm Monitor_Windows.pm 24 24 HTMLSOURCE=HTML/EN/plugins/AutoRescan/settings/basic.html 25 25 SOURCE=$(PERLSOURCE) $(HTMLSOURCE) INSTALL strings.txt install.xml LICENSE -
trunk/Monitor_Linux.pm
r402 r403 51 51 my $invocant = shift; 52 52 my $class = ref($invocant) || $invocant; 53 my $self = { }; 53 my $self = { 54 poll_each => 0, 55 }; 54 56 bless($self, $class); 55 57 -
trunk/Plugin.pm
r402 r403 26 26 # instructions on the kernel configuration. 27 27 # 28 # @@TODO@@ 29 # 28 30 # For further details see: 29 31 # http://www.hickinbottom.com … … 38 40 use utf8; 39 41 use Plugins::AutoRescan::Settings; 40 use Plugins::AutoRescan::Monitor_Linux;41 42 use Slim::Utils::Strings qw (string); 42 43 use Slim::Utils::Timers; … … 124 125 if ($os eq 'unix') { 125 126 $log->debug('Linux monitoring method selected'); 127 eval 'use Plugins::AutoRescan::Monitor_Linux'; 126 128 $monitor = Plugins::AutoRescan::Monitor_Linux->new($class); 127 } elsif ($os eq 'win dows') {129 } elsif ($os eq 'win') { 128 130 $log->debug('Windows monitoring method selected'); 129 #@@TODO@@ 131 eval 'use Plugins::AutoRescan::Monitor_Windows'; 132 $monitor = Plugins::AutoRescan::Monitor_Windows->new($class); 130 133 } else { 131 134 $log->warn("Unsupported operating system type '$os' - will not monitor for changes"); … … 173 176 } 174 177 175 # Add a n inotifywatch to the music folder.178 # Add a watch to the music folder. 176 179 sub addWatch() { 177 180 my $audioDir = $serverPrefs->get('audiodir'); 178 181 179 182 if (defined $audioDir && -d $audioDir) { 180 $log->debug("Adding inotifymonitor to music directory: $audioDir");183 $log->debug("Adding monitor to music directory: $audioDir"); 181 184 182 185 # Add the watch callback. This will also watch all subordinate folders. … … 216 219 # it's already being monitored later on. 217 220 $monitors{$dir} = $monitor->addWatch($dir); 218 } else {219 $log->debug("Not adding monitor, one is already present for: $dir");220 221 } 221 222 } … … 224 225 sub poller() { 225 226 226 # Pump that poller - let the monitors decide how to do that. 227 $monitor->poll if $monitor; 227 # Pump that poller - let the monitors decide how to do that. We support 228 # pumping for each monitored directory, or only once in total, depending 229 # on what the monitor type wants to do. 230 if ($monitor && $monitor->{poll_each}) { 231 # Loop through the monitored directories and poll each. 232 for my $dir (keys %monitors) { 233 $monitor->poll($dir, $monitors{$dir}); 234 } 235 } else { 236 # Pump the poller once. 237 $monitor->poll if $monitor; 238 } 228 239 229 240 # Flag of whether any rescanning was performed. … … 264 275 265 276 delete $touchedDirs{$dir}; 277 278 # Make sure we are monitoring any new subdirectories under here. 279 addNotifierRecursive($dir); 266 280 } 267 281 } -
trunk/install.xml
r402 r403 44 44 </targetApplication> 45 45 46 <targetPlatform>Linux</targetPlatform> 46 <!-- <targetPlatform>Linux</targetPlatform> --> 47 <!-- <targetPlatform>Windows</targetPlatform> --> 47 48 </extension>
Note: See TracChangeset
for help on using the changeset viewer.
