diff --git a/src/SongSave.cxx b/src/SongSave.cxx index 73fd032a9..039be9d87 100644 --- a/src/SongSave.cxx +++ b/src/SongSave.cxx @@ -51,7 +51,7 @@ range_save(BufferedOutputStream &os, unsigned start_ms, unsigned end_ms) void song_save(BufferedOutputStream &os, const Song &song) { - os.Format(SONG_BEGIN "%s\n", song.uri.c_str()); + os.Format(SONG_BEGIN "%s\n", song.filename.c_str()); range_save(os, song.start_time.ToMS(), song.end_time.ToMS()); diff --git a/src/SongUpdate.cxx b/src/SongUpdate.cxx index 733f0ef35..a4142f11c 100644 --- a/src/SongUpdate.cxx +++ b/src/SongUpdate.cxx @@ -110,7 +110,7 @@ Song::UpdateFileInArchive(ArchiveFile &archive) noexcept { assert(parent.device == DEVICE_INARCHIVE); - std::string path_utf8(uri); + std::string path_utf8(filename); for (const Directory *directory = &parent; directory->parent != nullptr && diff --git a/src/db/plugins/simple/Directory.cxx b/src/db/plugins/simple/Directory.cxx index e3821e259..3ad85d57c 100644 --- a/src/db/plugins/simple/Directory.cxx +++ b/src/db/plugins/simple/Directory.cxx @@ -191,7 +191,7 @@ Directory::FindSong(const char *name_utf8) const noexcept for (auto &song : songs) { assert(&song.parent == this); - if (song.uri == name_utf8) + if (song.filename == name_utf8) return &song; } diff --git a/src/db/plugins/simple/Song.cxx b/src/db/plugins/simple/Song.cxx index d4ee34c90..e71a885e0 100644 --- a/src/db/plugins/simple/Song.cxx +++ b/src/db/plugins/simple/Song.cxx @@ -30,7 +30,7 @@ Song::Song(DetachedSong &&other, Directory &_parent) noexcept mtime(other.GetLastModified()), start_time(other.GetStartTime()), end_time(other.GetEndTime()), - uri(other.GetURI()) + filename(other.GetURI()) { } @@ -38,17 +38,17 @@ std::string Song::GetURI() const noexcept { if (parent.IsRoot()) - return uri; + return filename; else { const char *path = parent.GetPath(); - return PathTraitsUTF8::Build(path, uri.c_str()); + return PathTraitsUTF8::Build(path, filename.c_str()); } } LightSong Song::Export() const noexcept { - LightSong dest(uri.c_str(), tag); + LightSong dest(filename.c_str(), tag); if (!parent.IsRoot()) dest.directory = parent.GetPath(); dest.mtime = mtime; diff --git a/src/db/plugins/simple/Song.hxx b/src/db/plugins/simple/Song.hxx index 8261748a8..17443fd45 100644 --- a/src/db/plugins/simple/Song.hxx +++ b/src/db/plugins/simple/Song.hxx @@ -91,11 +91,11 @@ struct Song { /** * The file name. */ - std::string uri; + std::string filename; - template - Song(U &&_uri, Directory &_parent) noexcept - :parent(_parent), uri(std::forward(_uri)) {} + template + Song(F &&_filename, Directory &_parent) noexcept + :parent(_parent), filename(std::forward(_filename)) {} Song(DetachedSong &&other, Directory &_parent) noexcept; diff --git a/src/db/plugins/simple/SongSort.cxx b/src/db/plugins/simple/SongSort.cxx index 982c07862..b75cd6194 100644 --- a/src/db/plugins/simple/SongSort.cxx +++ b/src/db/plugins/simple/SongSort.cxx @@ -96,7 +96,7 @@ song_cmp(const Song &a, const Song &b) noexcept return ret < 0; /* still no difference? compare file name */ - return IcuCollate(a.uri.c_str(), b.uri.c_str()) < 0; + return IcuCollate(a.filename.c_str(), b.filename.c_str()) < 0; } void diff --git a/src/db/update/Container.cxx b/src/db/update/Container.cxx index 562ea715c..d486580dd 100644 --- a/src/db/update/Container.cxx +++ b/src/db/update/Container.cxx @@ -76,7 +76,8 @@ UpdateWalk::UpdateContainerFile(Directory &directory, song->mtime = info.mtime; FormatDefault(update_domain, "added %s/%s", - contdir->GetPath(), song->uri.c_str()); + contdir->GetPath(), + song->filename.c_str()); { const ScopeDatabaseLock protect; diff --git a/src/db/update/Walk.cxx b/src/db/update/Walk.cxx index bb8a86bb4..fbdb2957e 100644 --- a/src/db/update/Walk.cxx +++ b/src/db/update/Walk.cxx @@ -81,7 +81,7 @@ UpdateWalk::RemoveExcludedFromDirectory(Directory &directory, directory.ForEachSongSafe([&](Song &song){ assert(&song.parent == &directory); - const auto name_fs = AllocatedPath::FromUTF8(song.uri.c_str()); + const auto name_fs = AllocatedPath::FromUTF8(song.filename.c_str()); if (name_fs.IsNull() || exclude_list.Check(name_fs)) { editor.DeleteSong(directory, &song); modified = true; @@ -103,7 +103,7 @@ UpdateWalk::PurgeDeletedFromDirectory(Directory &directory) noexcept directory.ForEachSongSafe([&](Song &song){ if (!directory_child_is_regular(storage, directory, - song.uri.c_str())) { + song.filename.c_str())) { editor.LockDeleteSong(directory, &song); modified = true;