DetachedSong: add attribute "real_uri"

Prepare for UPnP songs that retain there database identity.
This commit is contained in:
Max Kellermann
2014-01-18 18:20:54 +01:00
parent 483b1f51c9
commit 5d4b450c52
7 changed files with 62 additions and 11 deletions

View File

@@ -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