fix renaming local files in browser

master
unK 18 years ago
parent db6eb9bc38
commit 6f3276dffa
  1. 6
      src/tag_editor.cpp

@ -39,6 +39,7 @@ extern Menu<Song> *mPlaylist;
extern Menu<string> *mTagEditor;
extern Window *wFooter;
extern Window *wPrev;
SongSetFunction IntoSetFunction(mpd_TagItems tag)
{
@ -247,6 +248,8 @@ bool WriteTags(Song &s)
new_name += Config.mpd_music_dir;
new_name += s.GetDirectory() + "/" + s.GetNewName();
if (rename(old_name.c_str(), new_name.c_str()) == 0 && !file_is_from_db)
{
if (wPrev == mPlaylist)
{
// if we rename local file, it won't get updated
// so just remove it from playlist and add again
@ -260,6 +263,9 @@ bool WriteTags(Song &s)
Mpd->Move(s.GetPosition(), pos);
}
}
else // only mBrowser
s.SetFile(new_name);
}
}
return true;
}

Loading…
Cancel
Save