[SCM] kodi-pvr-vdr-vnsi/master: replace colons in timer file names
tiber-guest at users.alioth.debian.org
tiber-guest at users.alioth.debian.org
Sun Feb 28 15:46:51 UTC 2016
The following commit has been merged in the master branch:
commit bfce793a501ace5e52fddad8dbcb8910eaea6f2c
Author: Rainer Hochecker <fernetmenta at online.de>
Date: Wed Dec 9 11:52:20 2015 +0100
replace colons in timer file names
diff --git a/src/VNSIData.cpp b/src/VNSIData.cpp
index ca2366c..9a0c51c 100644
--- a/src/VNSIData.cpp
+++ b/src/VNSIData.cpp
@@ -445,34 +445,52 @@ PVR_ERROR cVNSIData::AddTimer(const PVR_TIMER &timerinfo)
// add directory in front of the title
std::string path;
- if(strlen(timerinfo.strDirectory) > 0) {
+ if (strlen(timerinfo.strDirectory) > 0)
+ {
path += timerinfo.strDirectory;
- if(path == "/") {
+ if (path == "/")
+ {
path.clear();
}
- else if(path.size() > 1) {
- if(path[0] == '/') {
+ else if (path.size() > 1)
+ {
+ if (path[0] == '/')
+ {
path = path.substr(1);
}
}
- if(path.size() > 0 && path[path.size()-1] != '/') {
+ if (path.size() > 0 && path[path.size()-1] != '/')
+ {
path += "/";
}
}
// replace directory separators
- for(std::size_t i=0; i<path.size(); i++) {
- if(path[i] == '/' || path[i] == '\\') {
+ for (std::size_t i=0; i<path.size(); i++)
+ {
+ if (path[i] == '/' || path[i] == '\\')
+ {
path[i] = '~';
}
}
- if(strlen(timerinfo.strTitle) > 0) {
+ if (strlen(timerinfo.strTitle) > 0)
+ {
path += timerinfo.strTitle;
}
- if(path.empty()) {
+ // replace colons
+ for (std::size_t i=0; i<path.size(); i++)
+ {
+ if (path[i] == ':')
+ {
+ path[i] = '|';
+ }
+ }
+
+ if (path.empty())
+ {
XBMC->Log(LOG_ERROR, "%s - Empty filename !", __FUNCTION__);
return PVR_ERROR_UNKNOWN;
}
--
kodi-pvr-vdr-vnsi packaging
More information about the pkg-multimedia-commits
mailing list