aboutsummaryrefslogtreecommitdiffstats
path: root/src/DetachedSong.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-18 18:20:54 +0100
committerMax Kellermann <max@duempel.org>2014-01-21 21:06:56 +0100
commit5d4b450c52b3af92a03a8380a40dc703f0df4233 (patch)
tree9f861173b3861c544670dfb3f38b436902f67b63 /src/DetachedSong.cxx
parent483b1f51c96303f2b587870cce6803cc6f699158 (diff)
downloadmpd-5d4b450c52b3af92a03a8380a40dc703f0df4233.tar.gz
mpd-5d4b450c52b3af92a03a8380a40dc703f0df4233.tar.xz
mpd-5d4b450c52b3af92a03a8380a40dc703f0df4233.zip
DetachedSong: add attribute "real_uri"
Prepare for UPnP songs that retain there database identity.
Diffstat (limited to 'src/DetachedSong.cxx')
-rw-r--r--src/DetachedSong.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/DetachedSong.cxx b/src/DetachedSong.cxx
index 4e52afb0c..83106edee 100644
--- a/src/DetachedSong.cxx
+++ b/src/DetachedSong.cxx
@@ -32,13 +32,23 @@ DetachedSong::DetachedSong(const LightSong &other)
bool
DetachedSong::IsRemote() const
{
- return uri_has_scheme(uri.c_str());
+ return uri_has_scheme(GetRealURI());
}
bool
DetachedSong::IsAbsoluteFile() const
{
- return PathTraitsUTF8::IsAbsolute(uri.c_str());
+ return PathTraitsUTF8::IsAbsolute(GetRealURI());
+}
+
+bool
+DetachedSong::IsInDatabase() const
+{
+ /* here, we use GetURI() and not GetRealURI() because
+ GetRealURI() is never relative */
+
+ const char *_uri = GetURI();
+ return !uri_has_scheme(_uri) && !PathTraitsUTF8::IsAbsolute(_uri);
}
double