diff options
author | geronimo <geronimo013@gmx.de> | 2012-07-25 07:40:19 +0200 |
---|---|---|
committer | geronimo <geronimo013@gmx.de> | 2012-07-25 07:40:19 +0200 |
commit | 2d0b837e6c885383ae807ca793cbe91aa32de995 (patch) | |
tree | 739e6f89a09ad9566c3d6de2f69495ddc5f75a44 /libs/fsScan | |
parent | 774e09eef2d7761814e6f19fb462eb0fdc74f2d7 (diff) | |
download | cmp-2d0b837e6c885383ae807ca793cbe91aa32de995.tar.gz cmp-2d0b837e6c885383ae807ca793cbe91aa32de995.tar.bz2 |
need both, encoded and decoded urls at backend
Diffstat (limited to 'libs/fsScan')
-rw-r--r-- | libs/fsScan/include/AbstractMedia.h | 4 | ||||
-rw-r--r-- | libs/fsScan/src/AbstractMedia.cc | 12 | ||||
-rw-r--r-- | libs/fsScan/src/FilesystemScanner.cc | 4 |
3 files changed, 9 insertions, 11 deletions
diff --git a/libs/fsScan/include/AbstractMedia.h b/libs/fsScan/include/AbstractMedia.h index e101948..573265b 100644 --- a/libs/fsScan/include/AbstractMedia.h +++ b/libs/fsScan/include/AbstractMedia.h @@ -54,9 +54,10 @@ public: const char *MimeType(void) const { return mimeType; } const char *AbsolutePath(void) const; ulong LastModified(void) const; + const char *LogicalPath(void) const { return logicalPath; } virtual const char *Name(void) const; virtual size_t Size(void) const; - virtual const char *URI(void) const; + virtual const char *URI(void) const { return uri; } virtual void Refresh(void); ///< will be called right before start streaming, so this call is used to ///< determine the real size, number of files, etc. @@ -74,6 +75,7 @@ private: SupportedMediaType mediaType; char *mimeType; char *uri; + char *logicalPath; cFile keyPath; }; diff --git a/libs/fsScan/src/AbstractMedia.cc b/libs/fsScan/src/AbstractMedia.cc index 54a60d6..1a7c1da 100644 --- a/libs/fsScan/src/AbstractMedia.cc +++ b/libs/fsScan/src/AbstractMedia.cc @@ -40,17 +40,18 @@ cAbstractMedia::cAbstractMedia(const cFile &File, const char *Mime, SupportedMed , mediaType(Type) , mimeType(Mime ? strdup(Mime) : NULL) , uri(NULL) + , logicalPath(NULL) , keyPath(File) { - char *tmp = keyPath.toURI(); - uri = cUrl::Decoder()->Decode(tmp); - free(tmp); + uri = keyPath.toURI(); + logicalPath = cUrl::Decoder()->Decode(uri); } cAbstractMedia::~cAbstractMedia() { free(mimeType); free(uri); + free(logicalPath); } const char *cAbstractMedia::Name(void) const @@ -113,11 +114,6 @@ ulong cAbstractMedia::LastModified(void) const return keyPath.LastModified(); } -const char *cAbstractMedia::URI(void) const -{ - return uri; -} - void cAbstractMedia::SetMimeType(const char *MimeType) { if (mimeType == MimeType) return; diff --git a/libs/fsScan/src/FilesystemScanner.cc b/libs/fsScan/src/FilesystemScanner.cc index 23b5074..cbe4b95 100644 --- a/libs/fsScan/src/FilesystemScanner.cc +++ b/libs/fsScan/src/FilesystemScanner.cc @@ -96,13 +96,13 @@ void cFilesystemScanner::Refresh() } } -cAbstractMedia *cFilesystemScanner::FindMedia(const char* URI) +cAbstractMedia *cFilesystemScanner::FindMedia(const char *Path) { cAbstractMedia *rv = NULL, *tmp; for (size_t i=0; i < pool.size(); ++i) { tmp = (cAbstractMedia *) pool[i]; - if (!strcmp(tmp->URI(), URI)) { + if (!strcmp(tmp->LogicalPath(), Path)) { rv = tmp; break; } |