Chinese translation updated

This commit is contained in:
stax76
2024-01-06 10:45:14 +01:00
parent 304fe58f27
commit ad94042a2c
4 changed files with 19 additions and 22 deletions

View File

@@ -390,9 +390,6 @@ public class MainPlayer : MpvClient
if (App.StartSize == "video")
WasInitialSizeSet = false;
if (!FileTypes.Video.Contains(Path.Ext()) || FileTypes.Audio.Contains(Path.Ext()))
UpdateVideoSize("width", "height");
TaskHelp.Run(UpdateTracks);
base.OnFileLoaded();
@@ -600,7 +597,7 @@ public class MainPlayer : MpvClient
dir = System.IO.Path.GetDirectoryName(path)!;
List<string> files = FileTypes.GetMediaFiles(Directory.GetFiles(dir)).ToList();
if (OperatingSystem.IsWindows())
files.Sort(new StringLogicalComparer());

View File

@@ -0,0 +1,73 @@
<#
This script updates mpv and libmpv using github.com/zhongfly/mpv-winbuild
Two positional command line arguments need to be passed into the script:
1. The directory containing libmpv to be updated.
2. The directory containing mpv to be updated.
To skip one of both pass 'no' instead of the path.
Requires 7zip being installed at 'C:\Program Files\7-Zip\7z.exe'
#>
$zip7Path = 'C:\Program Files\7-Zip\7z.exe'
$ScriptArgs = $args
# Stop when the first error occurs
$ErrorActionPreference = 'Stop'
# Throw exception if file or folder does not exist
function Test($path) {
if (-not (Test-Path $path)) {
throw $path
}
return $path
}
# Download file to temp dir and return file path
function Download($pattern) {
$api = "https://api.github.com/repos/zhongfly/mpv-winbuild/releases/latest"
$json = Invoke-WebRequest $api -MaximumRedirection 0 -ErrorAction Ignore -UseBasicParsing | ConvertFrom-Json
$filename = ($json.assets | Where-Object { $_.name -Match $pattern }).name
$path = Join-Path $env:TEMP $filename
$link = ($json.assets | Where-Object { $_.name -Match $pattern }).browser_download_url
Invoke-WebRequest -Uri $link -UserAgent "mpv-win-updater" -OutFile $path
return Test $path
}
function Unpack($archieveFile, $outputRootDir) {
$outputDir = Join-Path $outputRootDir $archieveFile.BaseName
if (Test-Path $outputDir) { Remove-Item $outputDir -Recurse }
$process = Start-Process (Test $zip7Path) @('x', $archieveFile.FullName, "-o$outputDir") -NoNewWindow -Wait
if ($process.ExitCode) { throw $process.ExitCode }
return Test $outputDir
}
function UpdateLibmpv {
$targetFolder = $ScriptArgs[0]
if ($targetFolder -eq 'no') { return }
$archiveFile = Get-Item (Download "mpv-dev-x86_64-[0-9]{8}")
$archiveDir = Unpack $archiveFile $env:TEMP
Copy-Item $archiveDir\libmpv-2.dll (Test $targetFolder) -Force
Remove-Item $archiveFile.FullName
Remove-Item $archiveDir -Recurse
}
function UpdateMpv() {
$targetFolder = $ScriptArgs[1]
if ($targetFolder -eq 'no') { return }
$archiveFile = Get-Item (Download "mpv-x86_64-[0-9]{8}")
$archiveDir = Unpack $archiveFile $env:TEMP
Copy-Item "$archiveDir\mpv\*" $targetFolder -Force -Recurse
Remove-Item $archiveFile.FullName
Remove-Item $archiveDir -Recurse
}
UpdateLibmpv
UpdateMpv
Write-Host 'Script finished successfully' -ForegroundColor Green