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

Method UpdateFileInArchive

src/SongUpdate.cxx:109–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109bool
110Song::UpdateFileInArchive(ArchiveFile &archive) noexcept
111{
112 assert(parent.device == DEVICE_INARCHIVE);
113
114 std::string path_utf8(filename);
115
116 for (const Directory *directory = &parent;
117 directory->parent != nullptr &&
118 directory->parent->device == DEVICE_INARCHIVE;
119 directory = directory->parent) {
120 path_utf8.insert(path_utf8.begin(), '/');
121 path_utf8.insert(0, directory->GetName());
122 }
123
124 TagBuilder tag_builder;
125 if (!tag_archive_scan(archive, path_utf8.c_str(), tag_builder))
126 return false;
127
128 tag_builder.Commit(tag);
129 return true;
130}
131
132#endif
133

Callers 2

LoadFromArchiveMethod · 0.80
UpdateArchiveTreeMethod · 0.80

Calls 3

tag_archive_scanFunction · 0.85
GetNameMethod · 0.80
CommitMethod · 0.45

Tested by

no test coverage detected