예제 #1
0
파일: prefs.py 프로젝트: Mellthas/quodlibet
 def __destroy(self):
     config.save()
     new_dirs = set(get_scan_dirs())
     gone_dirs = set(self.current_scan_dirs) - new_dirs
     if new_dirs - set(self.current_scan_dirs):
         print_d("Library paths have been added, re-scanning...")
         scan_library(app.library, force=False)
     elif gone_dirs:
         copool.add(app.librarian.remove_roots, gone_dirs)
예제 #2
0
    def plugin_on_changed(self, songs):
        song = songs[0]
        current_location = song("~filename")
        file_split = os.path.splitext(current_location)
        file_extension = file_split[1]
        psbl_new_location = os.path.abspath(
            os.path.expanduser((Pattern(self.config_get(self.CFG_PAT_PLAYING,
                                                        self.DEFAULT_PAT)) %
                                song) + file_extension))

        if(not(psbl_new_location == re.sub(" \\([0-9]+\\)$",
                                           "",
                                           file_split[0]) + file_extension)):
            dirname = os.path.dirname(psbl_new_location)
            if not os.path.exists(dirname):
                os.makedirs(dirname)

            if os.path.isfile(psbl_new_location):
                num_to_use = 1
                start_with = os.path.splitext(
                    os.path.basename(psbl_new_location))[0]
                length_chk = len(start_with) + 2

                for f in sorted(os.listdir(dirname)):
                    if f.startswith(start_with):
                        temporary = f[length_chk:]

                        if temporary[:temporary.find(")")] == str(num_to_use):
                            num_to_use += 1

                psbl_new_location = os.path.join(dirname,
                                                 start_with +
                                                 " (" + str(num_to_use) + ")" +
                                                 file_extension)

            try:
	            shutil.move(current_location, os.path.normpath(psbl_new_location))

	            self.removeEmptyDirs(os.path.dirname(current_location))

	            scan_library(app.library, False)
            except Exception:
예제 #3
0
파일: prefs.py 프로젝트: ch1huizong/scode
 def __destroy(self):
     config.write(const.CONFIG)
     if self.current_scan_dirs != get_scan_dirs():
         scan_library(app.library, force=False)
예제 #4
0
파일: prefs.py 프로젝트: ch1huizong/scode
 def reload_cb(button):
     scan_library(app.library, force=True)
예제 #5
0
파일: prefs.py 프로젝트: ch1huizong/scode
 def refresh_cb(button):
     scan_library(app.library, force=False)
예제 #6
0
def _refresh(app):
    scan_library(app.library, False)
예제 #7
0
def _refresh(app):
    scan_library(app.library, False)
예제 #8
0
파일: prefs.py 프로젝트: faubiguy/quodlibet
 def __destroy(self):
     config.save()
     if self.current_scan_dirs != get_scan_dirs():
         scan_library(app.library, force=False)
예제 #9
0
파일: prefs.py 프로젝트: faubiguy/quodlibet
 def reload_cb(button):
     scan_library(app.library, force=True)
예제 #10
0
파일: prefs.py 프로젝트: faubiguy/quodlibet
 def refresh_cb(button):
     scan_library(app.library, force=False)
예제 #11
0
 def __rebuild(self, activator, force):
     scan_library(self.__library, force)
예제 #12
0
파일: prefs.py 프로젝트: elfalem/quodlibet
 def __destroy(self):
     config.save()
     if self.current_scan_dirs != get_scan_dirs():
         print_d("Library paths have changed, re-scanning...")
         scan_library(app.library, force=False)
예제 #13
0
 def __destroy(self):
     config.save()
     if self.current_scan_dirs != get_scan_dirs():
         print_d("Library paths have changed, re-scanning...")
         scan_library(app.library, force=False)
예제 #14
0
 def __destroy(self):
     config.save()
     if self.current_scan_dirs != get_scan_dirs():
         scan_library(app.library, force=False)
예제 #15
0
 def __rebuild(self, activator, force):
     scan_library(self.__library, force)
예제 #16
0
파일: prefs.py 프로젝트: brunob/quodlibet
 def __destroy(self):
     config.write(const.CONFIG)
     if self.current_scan_dirs != get_scan_dirs():
         scan_library(app.library, force=False)