MCPcopy Create free account
hub / github.com/MusicPlayerDaemon/MPD / LoadFile

Method LoadFile

src/SongLoader.cxx:38–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38DetachedSong
39SongLoader::LoadFile(const char *path_utf8, Path path_fs) const
40{
41#ifdef ENABLE_DATABASE
42 if (storage != nullptr) {
43 const auto suffix = storage->MapToRelativeUTF8(path_utf8);
44 if (suffix.data() != nullptr)
45 /* this path was relative to the music
46 directory - obtain it from the database */
47 return LoadFromDatabase(std::string(suffix).c_str());
48 }
49#endif
50
51 DetachedSong song(path_utf8);
52 if (!song.LoadFile(path_fs))
53 throw PlaylistError::NoSuchSong();
54
55 return song;
56}
57
58DetachedSong
59SongLoader::LoadSong(const LocatedUri &located_uri) const

Callers 1

handle_lsinfo_pathFunction · 0.45

Calls 1

MapToRelativeUTF8Method · 0.45

Tested by

no test coverage detected