diff options
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; } |