The branch, frodo has been updated
via 32d7bade88698f6ca3b010daf1995c5f30d59f01 (commit)
via ed03cbb61e48bc63e828bb21960ff7eebaf9b856 (commit)
from 673b72f395cb62e631056d9c3672dd94ecebdc68 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=32d7bade88698f6ca3b010daf1995c5f30d59f01
commit 32d7bade88698f6ca3b010daf1995c5f30d59f01
Author: Martijn Kaijser <[email protected]>
Date: Tue Sep 17 08:45:49 2013 +0200
[script.artistslideshow] 1.5.6
diff --git a/script.artistslideshow/addon.xml b/script.artistslideshow/addon.xml
index ed0ec08..c8a0c72 100644
--- a/script.artistslideshow/addon.xml
+++ b/script.artistslideshow/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="script.artistslideshow" name="Artist Slideshow" version="1.5.4"
provider-name="ronie|pkscuot">
+<addon id="script.artistslideshow" name="Artist Slideshow" version="1.5.6"
provider-name="ronie|pkscuot">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.elementtree" version="1.2.7"/>
diff --git a/script.artistslideshow/changelog.txt
b/script.artistslideshow/changelog.txt
index ca178e5..641bd52 100644
--- a/script.artistslideshow/changelog.txt
+++ b/script.artistslideshow/changelog.txt
@@ -1,3 +1,10 @@
+v.1.5.6
+- adjusted artist bio cleanup to better handle HTML code (thx to scott967)
+- fix for SpotiMC stuttering when using Artist Slideshow (thx to McMuzz4)
+
+v.1.5.5
+internal beta test
+
v.1.5.4
- artist bio and album list now come from theaudiodb.com by default (Last.fm
as fallback)
- added download of images from fanart.tv
@@ -16,7 +23,7 @@ v.1.5.4
- changed over to urllib2 for downloads
- additional error catching across the board
-v1.5.3
+v.1.5.3
internal beta test
v.1.5.2
@@ -32,7 +39,7 @@ v.1.5.2
- changed over to Frodo .po language files
- updated addon.xml with new information and format for repo database
-v1.5.1
+v.1.5.1
internal beta test
v.1.5.0
diff --git a/script.artistslideshow/default.py
b/script.artistslideshow/default.py
index ef71bd5..012827b 100644
--- a/script.artistslideshow/default.py
+++ b/script.artistslideshow/default.py
@@ -163,13 +163,13 @@ def grabURL( url, *args, **kwargs ):
return url_data
def cleanText(text):
- text = re.sub('<a href="http://www.last.fm/music/.*</a>.','',text)
- text = re.sub('<(.|\n|\r)*?>','',text)
+ text = re.sub('<a [^>]*>|</a>|<span[^>]*>|</span>','',text)
text = re.sub('"','"',text)
text = re.sub('&','&',text)
text = re.sub('>','>',text)
text = re.sub('<','<',text)
text = re.sub('User-contributed text is available under the Creative
Commons By-SA License and may also be available under the GNU FDL.','',text)
+ text = re.sub('Read more about .* on Last.fm.','',text)
return text.strip()
def path_leaf(path):
@@ -258,11 +258,11 @@ class Main:
self._set_property("ArtistSlideshowRunning")
else:
log('first song started')
- time.sleep(0.5) # it may take some time for xbmc to read tag
info after playback started
+ time.sleep(1) # it may take some time for xbmc to read tag
info after playback started
self._use_correct_artwork()
self._trim_cache()
while (not xbmc.abortRequested):
- time.sleep(0.5)
+ time.sleep(1)
if xbmc.getInfoLabel( self.ARTISTSLIDESHOWRUNNING ) == "True":
if( xbmc.Player().isPlayingAudio() == True or
xbmc.getInfoLabel( self.EXTERNALCALL ) != '' ):
if set( self.ALLARTISTS ) <> set(
self._get_current_artists() ):
@@ -420,6 +420,8 @@ class Main:
self.NAME = ''
self.ALLARTISTS = []
self.MBID = ''
+ self.LASTPLAYINGFILE = ''
+ self.LASTJSONRESPONSE = ''
self.LocalImagesFound = False
self.CachedImagesFound = False
self.ImageDownloaded = False
@@ -443,7 +445,6 @@ class Main:
self.HtbackdropsDownloadURL = 'http://htbackdrops.org/api/' +
HtbackdropsApiKey + '/download/'
-
def _move_info_files( self, old_loc, new_loc, type ):
log( 'attempting to move from %s to %s' % (old_loc, new_loc) )
try:
@@ -718,7 +719,21 @@ class Main:
artists_info = []
mbids = []
if( xbmc.Player().isPlayingAudio() == True ):
- response = xbmc.executeJSONRPC ( '{"jsonrpc":"2.0",
"method":"Player.GetItem", "params":{"playerid":0, "properties":["artist",
"musicbrainzartistid"]},"id":1}' )
+ try:
+ playing_file = xbmc.Player().getPlayingFile()
+ except RuntimeError:
+ return artists_info
+ except Exception, e:
+ log( 'unexpected error getting playing file back from XBMC' )
+ log( e )
+ return artists_info
+ if playing_file != self.LASTPLAYINGFILE:
+ # if the same file is playing, use cached JSON response
instead of doing a new query
+ response = xbmc.executeJSONRPC ( '{"jsonrpc":"2.0",
"method":"Player.GetItem", "params":{"playerid":0, "properties":["artist",
"musicbrainzartistid"]},"id":1}' )
+ self.LASTPLAYINGFILE = playing_file
+ self.LASTJSONRESPONSE = response
+ else:
+ response = self.LASTJSONRESPONSE
try:
artist_names = json.loads(response)['result']['item']['artist']
except (IndexError, KeyError, ValueError):
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=ed03cbb61e48bc63e828bb21960ff7eebaf9b856
commit ed03cbb61e48bc63e828bb21960ff7eebaf9b856
Author: Martijn Kaijser <[email protected]>
Date: Tue Sep 17 08:44:29 2013 +0200
[script.filecleaner] 3.1.0
diff --git a/script.filecleaner/addon.xml b/script.filecleaner/addon.xml
index e0453aa..a58ea48 100644
--- a/script.filecleaner/addon.xml
+++ b/script.filecleaner/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="script.filecleaner" name="XBMC File Cleaner" version="3.0.2"
provider-name="Anthirian">
+<addon id="script.filecleaner" name="XBMC File Cleaner" version="3.1.0"
provider-name="Anthirian">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="xbmc.json" version="6.0.0"/>
diff --git a/script.filecleaner/changelog.txt b/script.filecleaner/changelog.txt
index 4ea56ad..87eb310 100644
--- a/script.filecleaner/changelog.txt
+++ b/script.filecleaner/changelog.txt
@@ -1,3 +1,11 @@
+Version 3.1.0
+===============
+- New option to exclude up to three file paths from being modified
+
+Version 3.0.2
+===============
+- Fixed support for filenames with non-ASCII characters
+
Version 3.0.1
===============
- Fixed bug in setting locale that broke the addon
diff --git a/script.filecleaner/default.py b/script.filecleaner/default.py
index 1b8b888..3a258a9 100644
--- a/script.filecleaner/default.py
+++ b/script.filecleaner/default.py
@@ -143,17 +143,18 @@ class Cleaner:
count = 0
for abs_path, show_name, season_number in episodes:
if xbmcvfs.exists(abs_path):
- cleaning_required = True
if not self.delete_files:
if self.create_subdirs:
new_path =
os.path.join(self.holding_folder, show_name, "Season %d" % season_number)
else:
new_path = self.holding_folder
if self.move_file(abs_path, new_path):
+ cleaning_required = True
count += 1
self.delete_empty_folders(os.path.dirname(abs_path))
else:
if self.delete_file(abs_path):
+ cleaning_required = True
count += 1
self.delete_empty_folders(os.path.dirname(abs_path))
else:
@@ -386,6 +387,77 @@ class Cleaner:
self.not_in_progress = bool(__settings__.getSetting("not_in_progress")
== "true")
+ self.exclusion_enabled =
bool(__settings__.getSetting("exclusion_enabled") == "true")
+ self.exclusion1 =
xbmc.translatePath(__settings__.getSetting("exclusion1"))
+ self.exclusion2 =
xbmc.translatePath(__settings__.getSetting("exclusion2"))
+ self.exclusion3 =
xbmc.translatePath(__settings__.getSetting("exclusion3"))
+
+ def is_excluded(self, full_path):
+ """Check if the file path is part of the excluded sources. Returns
True if the file is part of the excluded
+ sources, False otherwise. Also returns False when an error occurs to
prevent data loss.
+
+ :type full_path: str
+ :param full_path: the path to the file that should be checked for
exclusion
+ :rtype: bool
+ """
+ if not self.exclusion_enabled:
+ self.debug("Path exclusion is disabled.")
+ return False
+
+ if not full_path:
+ self.debug("File path is empty and cannot be checked for
exclusions")
+ return False
+
+ exclusions = [self.exclusion1, self.exclusion2, self.exclusion3]
+
+ if r"://" in full_path:
+ self.debug("Detected a network path")
+ pattern =
re.compile("(?:smb|afp|nfs)://(?:(?:.+):(?:.+)@)?(?P<tail>.*)$", flags=re.U |
re.I)
+
+ self.debug("Converting excluded network paths for easier
comparison")
+ normalized_exclusions = []
+ for ex in exclusions:
+ # Strip everything but the folder structure
+ try:
+ if ex and r"://" in ex:
+ # Only normalize non-empty excluded paths
+
normalized_exclusions.append(pattern.match(ex).group("tail").lower())
+ except (AttributeError, IndexError, KeyError):
+ self.debug("Could not parse the excluded network path
'%s'" % ex, xbmc.LOGWARNING)
+ return True
+
+ self.debug("Conversion result: %s" % normalized_exclusions)
+
+ self.debug("Proceeding to match a file with the exclusion paths")
+ self.debug("The file to match is '%s'" % full_path)
+ result = pattern.match(full_path)
+
+ try:
+ self.debug("Converting file path for easier comparison.")
+ converted_path = result.group("tail").lower()
+ self.debug("Result: '%s'" % converted_path)
+ for ex in normalized_exclusions:
+ self.debug("Checking against exclusion '%s'" % ex)
+ if converted_path.startswith(ex):
+ self.debug("File '%s' matches excluded path '%s'." %
(converted_path, ex))
+ return True
+
+ self.debug("No match was found with an excluded path.")
+ return False
+
+ except (AttributeError, IndexError, KeyError):
+ self.debug("Error converting '%s'. No files will be deleted" %
full_path, xbmc.LOGWARNING)
+ return True
+ else:
+ self.debug("Detected a local path")
+ for ex in exclusions:
+ if ex and full_path.startswith(ex):
+ self.debug("File '%s' matches excluded path '%s'." %
(full_path, ex))
+ return True
+
+ self.debug("No match was found with an excluded path.")
+ return False
+
def get_free_disk_space(self, path):
"""Determine the percentage of free disk space.
@@ -482,6 +554,10 @@ class Cleaner:
:rtype : bool
"""
self.debug("Deleting file at %s" % location)
+ if self.is_excluded(location):
+ self.debug("This file is found on an excluded path and will not be
deleted.")
+ return False
+
if xbmcvfs.exists(location):
return xbmcvfs.delete(location)
else:
@@ -563,6 +639,9 @@ class Cleaner:
:param dest_folder: the destination path (absolute)
:rtype : bool
"""
+ if self.is_excluded(source):
+ self.debug("This file is found on an excluded path and will not be
moved.")
+ return False
if isinstance(source, unicode):
source = source.encode("utf-8")
dest_folder = xbmc.makeLegalFilename(dest_folder)
diff --git a/script.filecleaner/resources/language/Dutch/strings.xml
b/script.filecleaner/resources/language/Dutch/strings.xml
index 28d9a53..826df0a 100644
--- a/script.filecleaner/resources/language/Dutch/strings.xml
+++ b/script.filecleaner/resources/language/Dutch/strings.xml
@@ -3,7 +3,8 @@
<string id="32100">Acties</string>
<string id="32200">Frequentie</string>
<string id="32300">Voorwaarden</string>
- <string id="32400">Meldingen</string>
+ <string id="32400">Uitzonderingen</string>
+ <string id="32500">Meldingen</string>
<!-- Actiestabblad -->
<string id="32101">[B]Welke video's wil je verwijderen?[/B]</string>
@@ -51,13 +52,19 @@
<string id="32311">Verwijder geen video's die halverwege gestopt
zijn</string>
<string id="32312">[I]Videoclips onthouden niet tot hoever ze afgespeeld
zijn en negeren dit [/I]</string>
+ <!-- Uitzonderingentabblad -->
+ <string id="32401">[B]Welke bestanden mogen niet verwijderd
worden?[/B]</string>
+ <string id="32402">Maak een uitzondering</string>
+ <string id="32403">[I]Gebruik hetzelfde soort paden (lokaal, NFS, SMB) als
voor de bibliotheek [I]</string>
+ <string id="32404">Locatie van uitzondering</string>
+
<!-- Meldingentabblad -->
- <string id="32401">[B]Hoeveel informatie wil je krijgen?[/B]</string>
+ <string id="32501">[B]Hoeveel informatie wil je krijgen?[/B]</string>
- <string id="32402">Toon meldingen</string>
- <string id="32403">Toon geen meldingen als er video afgespeeld
wordt</string>
+ <string id="32502">Toon meldingen</string>
+ <string id="32503">Toon geen meldingen als er video afgespeeld
wordt</string>
- <string id="32404">Toon debuginformatie</string>
+ <string id="32504">Toon debuginformatie</string>
<!-- Gelokaliseerde teksten voor XBMC meldingen -->
<string id="32511">Fout bij lezen van harde schijf. Controleer de
instellingen.</string>
diff --git a/script.filecleaner/resources/language/English/strings.xml
b/script.filecleaner/resources/language/English/strings.xml
index 9a7038e..551883d 100644
--- a/script.filecleaner/resources/language/English/strings.xml
+++ b/script.filecleaner/resources/language/English/strings.xml
@@ -3,7 +3,8 @@
<string id="32100">Actions</string>
<string id="32200">Frequency</string>
<string id="32300">Conditions</string>
- <string id="32400">Notifications</string>
+ <string id="32400">Exclusions</string>
+ <string id="32500">Notifications</string>
<!-- Actions section -->
<string id="32101">[B]Which videos do you want to delete?[/B]</string>
@@ -51,14 +52,20 @@
<string id="32311">Do not delete videos that are still in progress</string>
<string id="32312">[I]Note that music videos cannot be partially played
and will ignore this [/I]</string>
+ <!-- Exclusions section -->
+ <string id="32401">[B]Which paths must not be touched?[/B]</string>
+ <string id="32402">Enable exclusions</string>
+ <string id="32403">[I]Use the same type of path (local, NFS, SMB) you use
for the library [/I]</string>
+ <string id="32404">Path to exclude</string>
+
<!-- Notifications section -->
- <string id="32401">[B]How much information do you want to get?[/B]</string>
+ <string id="32501">[B]How much information do you want to get?[/B]</string>
- <string id="32402">Show notifications</string>
- <string id="32403">Do not show notifications during video playback</string>
+ <string id="32502">Show notifications</string>
+ <string id="32503">Do not show notifications during video playback</string>
+
+ <string id="32504">Enable debug messages</string>
- <string id="32404">Enable debug messages</string>
-
<!-- Localization strings for XBMC notifications -->
<string id="32511">Error reading hard disk. Please check your
settings.</string>
<string id="32512">Could not check disk space. Access denied.</string>
diff --git a/script.filecleaner/resources/settings.xml
b/script.filecleaner/resources/settings.xml
index 893f058..b9dbc2a 100644
--- a/script.filecleaner/resources/settings.xml
+++ b/script.filecleaner/resources/settings.xml
@@ -60,15 +60,28 @@
<setting label="32312" id="musicvideo_progress_info" type="lsep"
subsetting="true" visible="eq(-1,true)" />
</category>
- <!-- Notifications section -->
- <category label="32400" id="notifications_section">
+ <!-- Exclusions section -->
+ <category label="32400" id="exclusions_section">
<setting type="sep" />
<setting label="32401" type="lsep" />
<setting type="sep" />
- <setting label="32402" id="notifications_enabled" type="bool"
default="true" visible="true" />
- <setting label="32403" id="notify_when_idle" type="bool"
default="true" subsetting="true" visible="eq(-1,true)" />
+ <setting label="32402" id="exclusion_enabled" type="bool"
default="false" visible="true" />
+ <setting label="32403" type="lsep" subsetting="true"
visible="eq(-1,true)" />
+ <setting label="32404" id="exclusion1" type="folder" default=""
subsetting="true" visible="eq(-2,true)" />
+ <setting label="32404" id="exclusion2" type="folder" default=""
subsetting="true" visible="eq(-3,true)" />
+ <setting label="32404" id="exclusion3" type="folder" default=""
subsetting="true" visible="eq(-4,true)" />
+ </category>
+
+ <!-- Notifications section -->
+ <category label="32500" id="notifications_section">
+ <setting type="sep" />
+ <setting label="32501" type="lsep" />
+ <setting type="sep" />
+
+ <setting label="32502" id="notifications_enabled" type="bool"
default="true" visible="true" />
+ <setting label="32503" id="notify_when_idle" type="bool"
default="true" subsetting="true" visible="eq(-1,true)" />
- <setting label="32404" id="debugging_enabled" type="bool"
default="false" visible="true" />
+ <setting label="32504" id="debugging_enabled" type="bool"
default="false" visible="true" />
</category>
</settings>
-----------------------------------------------------------------------
Summary of changes:
script.artistslideshow/addon.xml | 2 +-
script.artistslideshow/changelog.txt | 11 ++-
script.artistslideshow/default.py | 27 +++++--
script.filecleaner/addon.xml | 2 +-
script.filecleaner/changelog.txt | 8 ++
script.filecleaner/default.py | 81 +++++++++++++++++++-
.../resources/language/Dutch/strings.xml | 17 +++-
.../resources/language/English/strings.xml | 19 +++--
script.filecleaner/resources/settings.xml | 23 +++++-
9 files changed, 163 insertions(+), 27 deletions(-)
hooks/post-receive
--
Scripts
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons