db/simple/Song: rename "uri" to "filename"

This attribute is not a URI; it is just the filename without its
parent directory path.  To avoid confusion, let's rename it to
"filename", leaving the struct without a "uri" attribute.
This commit is contained in:
Max Kellermann
2019-09-04 11:20:18 +02:00
parent a727150c8d
commit 7775691965
8 changed files with 16 additions and 15 deletions

View File

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

View File

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