mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-31 18:17:29 +01:00
Try to choose a media device that have the word "back" in it, if it doesn't find one falls back to the first. (#573)
This commit is contained in:
@@ -34,7 +34,14 @@
|
||||
sources.value = devices;
|
||||
|
||||
if (devices.length > 0) {
|
||||
selectedSource.value = devices[0].deviceId;
|
||||
for (let i = 0; i < devices.length; i++) {
|
||||
if (devices[i].label.toLowerCase().includes("back")) {
|
||||
selectedSource.value = devices[i].deviceId;
|
||||
}
|
||||
}
|
||||
if (!selectedSource.value) {
|
||||
selectedSource.value = devices[0].deviceId;
|
||||
}
|
||||
} else {
|
||||
errorMessage.value = t("scanner.no_sources");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user