handle all types of musiclists

This commit is contained in:
sD 2020-02-23 12:25:10 +01:00
parent 444b0ff60f
commit 1291e776b6

View File

@ -96,22 +96,31 @@ QString AOApplication::get_sounds_path(QString p_file)
QString AOApplication::get_music_path(QString p_song) QString AOApplication::get_music_path(QString p_song)
{ {
QString withending_check = get_base_path() + "sounds/music/" + p_song;
QString mp3_check = get_base_path() + "sounds/music/" + p_song + ".mp3"; QString mp3_check = get_base_path() + "sounds/music/" + p_song + ".mp3";
QString opus_check = get_base_path() + "sounds/music/" + p_song + ".opus"; QString opus_check = get_base_path() + "sounds/music/" + p_song + ".opus";
if (file_exists(opus_check)) if (file_exists(opus_check))
{ {
#ifndef CASE_SENSITIVE_FILESYSTEM #ifndef CASE_SENSITIVE_FILESYSTEM
return get_base_path() + "sounds/music/" + p_song + ".opus"; return opus_check;
#else #else
return get_case_sensitive_path(get_base_path() + "sounds/music/" + p_song + ".opus"); return get_case_sensitive_path(opus_check);
#endif #endif
} }
else if (file_exists(mp3_check)) else if (file_exists(mp3_check))
{ {
#ifndef CASE_SENSITIVE_FILESYSTEM #ifndef CASE_SENSITIVE_FILESYSTEM
return get_base_path() + "sounds/music/" + p_song + ".mp3"; return mp3_check;
#else #else
return get_case_sensitive_path(get_base_path() + "sounds/music/" + p_song + ".mp3"); return get_case_sensitive_path(mp3_check);
#endif
}
else if (file_exists(withending_check))
{
#ifndef CASE_SENSITIVE_FILESYSTEM
return withending_check;
#else
return get_case_sensitive_path(withending_check);
#endif #endif
} }
#ifndef CASE_SENSITIVE_FILESYSTEM #ifndef CASE_SENSITIVE_FILESYSTEM