Compare commits

...

3 commits

Author SHA1 Message Date
advplyr
18200a8f01
Merge pull request #4533 from sir-wilhelm/wmic_replacement
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Run Component Tests / Run Component Tests (push) Waiting to run
Build and Push Docker Image / build (push) Waiting to run
Integration Test / build and test (push) Waiting to run
Run Unit Tests / Run Unit Tests (push) Waiting to run
Use PowerShell to get windows drive paths.
2025-08-23 17:55:50 -04:00
advplyr
9c47f404c9 Fix current author not showing in podcast match #4617 2025-08-23 16:55:32 -05:00
sir-wilhelm
cae1560344 Use PowerShell to get windows drive paths.
wmic has been deprecated on newer versions of Windows 11 and is not installed.

resolves #4531
2025-07-25 12:34:29 -05:00
2 changed files with 4 additions and 5 deletions

View file

@ -77,8 +77,8 @@
<ui-checkbox v-model="selectedMatchUsage.author" checkbox-bg="bg" @input="checkboxToggled" />
<div class="grow ml-4">
<ui-text-input-with-label v-model="selectedMatch.author" :disabled="!selectedMatchUsage.author" :label="$strings.LabelAuthor" />
<p v-if="mediaMetadata.authorName" class="text-xs ml-1 text-white/60">
{{ $strings.LabelCurrently }} <a title="$strings.LabelClickToUseCurrentValue" class="cursor-pointer hover:underline" @click.stop="setMatchFieldValue('author', mediaMetadata.authorName)">{{ mediaMetadata.authorName }}</a>
<p v-if="mediaMetadata.authorName || (isPodcast && mediaMetadata.author)" class="text-xs ml-1 text-white/60">
{{ $strings.LabelCurrently }} <a title="$strings.LabelClickToUseCurrentValue" class="cursor-pointer hover:underline" @click.stop="setMatchFieldValue('author', isPodcast ? mediaMetadata.author : mediaMetadata.authorName)">{{ isPodcast ? mediaMetadata.author : mediaMetadata.authorName }}</a>
</p>
</div>
</div>

View file

@ -476,7 +476,7 @@ module.exports.getWindowsDrives = async () => {
return []
}
return new Promise((resolve, reject) => {
exec('wmic logicaldisk get name', async (error, stdout, stderr) => {
exec('powershell -Command "(Get-PSDrive -PSProvider FileSystem).Name"', async (error, stdout, stderr) => {
if (error) {
reject(error)
return
@ -485,10 +485,9 @@ module.exports.getWindowsDrives = async () => {
?.split(/\r?\n/)
.map((line) => line.trim())
.filter((line) => line)
.slice(1)
const validDrives = []
for (const drive of drives) {
let drivepath = drive + '/'
let drivepath = drive + ':/'
if (await fs.pathExists(drivepath)) {
validDrives.push(drivepath)
} else {