fixed broken audio alerts after media file cleanup

merge-requests/88/head
christian 2021-04-03 07:45:03 -04:00
rodzic f79c7550de
commit 6cce130d12
1 zmienionych plików z 10 dodań i 0 usunięć

Wyświetl plik

@ -642,6 +642,16 @@ function playAlertMediaFile(filename, overrideMute)
{
if (g_appSettings.alertMute && !overrideMute) return;
// check if this is an alert stored with an older version of GT
// which has a full file path given.
if (path.isAbsolute(filename) && !fs.existsSync(filename)){
// full alert file name stored with old GT version referencing
// the user media dir. determine basename of the file and try
// constructing the path
filename = path.basename(filename);
}
// construct the path from the user media dir or
// fall back on the global media dir
var fpath = path.join(g_userMediaDir, filename);
if (!fs.existsSync(fpath)) fpath = path.join(g_gtMediaDir, filename);