Skip to content

Commit

Permalink
Дополнение к 0ee5f2a - при открытии аудио-файла не отображаем полный …
Browse files Browse the repository at this point in the history
…путь в списке аудио.
  • Loading branch information
Aleksoid1978 committed Feb 28, 2024
1 parent 480ed74 commit 7cfc31c
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions src/apps/mplayerc/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15699,20 +15699,24 @@ void CMainFrame::SetupAudioTracksSubMenu()
bool fExternal = false;
CPlaylistItem pli;
if (m_wndPlaylistBar.GetCur(pli)) {
auto mainFileDir = GetFolderOnly(pli.m_fi);
for (const auto& fi : pli.m_auds) {
auto& audioFile = fi.GetPath();
if (!audioFile.IsEmpty() && name == audioFile) {
auto audioFileDir = GetFolderOnly(audioFile);
if (!mainFileDir.IsEmpty() && audioFileDir != mainFileDir && StartsWith(name, mainFileDir.GetString())) {
name.Delete(0, mainFileDir.GetLength());
} else {
name = GetFileOnly(name.GetString());
}
if (!pli.m_auds.empty()) {
auto mainFileDir = GetFolderOnly(pli.m_fi);
for (const auto& fi : pli.m_auds) {
auto& audioFile = fi.GetPath();
if (!audioFile.IsEmpty() && name == audioFile) {
auto audioFileDir = GetFolderOnly(audioFile);
if (!mainFileDir.IsEmpty() && audioFileDir != mainFileDir && StartsWith(name, mainFileDir.GetString())) {
name.Delete(0, mainFileDir.GetLength());
} else {
name = GetFileOnly(name.GetString());
}

fExternal = true;
break;
fExternal = true;
break;
}
}
} else if (name == pli.m_fi.GetPath()) {
name = GetFileOnly(name.GetString());
}
}

Expand Down

0 comments on commit 7cfc31c

Please sign in to comment.