|
@@ -9,9 +9,9 @@
|
|
|
private string ExportDomain { get; set; } = "brrr";
|
|
|
private bool ExportDateCheck { get; set; } = true;
|
|
|
private string ExportDate { get; set; } = "brrr";
|
|
|
- private string ExportExtension { get; set; } = "m3u";
|
|
|
- private int ExportCodePage { get; set; } = 65001;
|
|
|
- private string ExportMime { get; set; } = "text/mpegurl";
|
|
|
+ private string ExportExtension { get; set; } = "brrr";
|
|
|
+ private int ExportCodePage { get; set; } = 0;
|
|
|
+ private string ExportMime { get; set; } = "brrrr";
|
|
|
}
|
|
|
|
|
|
<FnzBootstrapModal @ref="mdl">
|
|
@@ -19,7 +19,10 @@
|
|
|
<Body>
|
|
|
<div class="input-group mb-3">
|
|
|
<span class="input-group-text">File Name</span>
|
|
|
- <InputText class="form-control" placeholder="Filename" ValueExpression="()=>ExportName" Value="@ExportName"></InputText>
|
|
|
+ <InputText class="form-control" placeholder="Filename"
|
|
|
+ Value="@ExportName"
|
|
|
+ ValueExpression="()=>ExportName"
|
|
|
+ ValueChanged="s=>ExportName=s"></InputText>
|
|
|
</div>
|
|
|
<div class="input-group mb-3">
|
|
|
<div class="input-group-text">
|
|
@@ -28,7 +31,10 @@
|
|
|
<span class="align-middle">-Host</span>
|
|
|
</label>
|
|
|
</div>
|
|
|
- <InputText class="form-control" ValueExpression="()=>ExportDomain" Value="@ExportDomain"></InputText>
|
|
|
+ <InputText class="form-control"
|
|
|
+ Value="@ExportDomain"
|
|
|
+ ValueExpression="()=>ExportDomain"
|
|
|
+ ValueChanged="s=>ExportDomain=s"></InputText>
|
|
|
</div>
|
|
|
<div class="input-group mb-3">
|
|
|
<div class="input-group-text">
|
|
@@ -37,15 +43,17 @@
|
|
|
<span class="align-middle">-Date</span>
|
|
|
</label>
|
|
|
</div>
|
|
|
- <InputText class="form-control" ValueExpression="()=>ExportDate" Value="@ExportDate"></InputText>
|
|
|
- </div>
|
|
|
- <div class="input-group mb-3">
|
|
|
- <span class="input-group-text">Extension</span>
|
|
|
- <InputText type="text" class="form-control" placeholder="Extension" ValueExpression="()=>ExportExtension" Value="@ExportExtension"></InputText>
|
|
|
+ <InputText class="form-control"
|
|
|
+ Value="@ExportDate"
|
|
|
+ ValueExpression="()=>ExportDate"
|
|
|
+ ValueChanged="s=>ExportDate=s"></InputText>
|
|
|
</div>
|
|
|
<div class="input-group mb-3">
|
|
|
<span class="input-group-text">Text Encoding</span>
|
|
|
- <InputSelect class="form-control" TValue="int" Value="ExportCodePage" ValueExpression="() => ExportCodePage" ValueChanged="x=>ExportCodePage=x">
|
|
|
+ <InputSelect class="form-control" TValue="int"
|
|
|
+ Value="ExportCodePage"
|
|
|
+ ValueExpression="() => ExportCodePage"
|
|
|
+ ValueChanged="i=>EncodingChanged(i)">
|
|
|
@foreach (var en in Encoding.GetEncodings()
|
|
|
.OrderBy(p => p.Name != "utf-8")
|
|
|
.ThenBy(p => p.Name != "gb2312")
|
|
@@ -57,6 +65,13 @@
|
|
|
</InputSelect>
|
|
|
</div>
|
|
|
<div class="input-group mb-3">
|
|
|
+ <span class="input-group-text">Extension</span>
|
|
|
+ <InputText type="text" class="form-control" placeholder="Extension"
|
|
|
+ Value="@ExportExtension"
|
|
|
+ ValueExpression="()=>ExportExtension"
|
|
|
+ ValueChanged="s=>ExportExtension=s"></InputText>
|
|
|
+ </div>
|
|
|
+ <div class="input-group mb-3">
|
|
|
<span class="input-group-text">Mime</span>
|
|
|
<InputText type="text" class="form-control" placeholder="Extension" ValueExpression="()=>ExportMime" Value="@ExportMime"></InputText>
|
|
|
</div>
|
|
@@ -77,13 +92,25 @@
|
|
|
ExportName = $"{playlist}";
|
|
|
ExportDomain = uri.Host;
|
|
|
ExportDate = $"{DateTime.Now:yyMMdd}";
|
|
|
+ ExportCodePage = 65001;
|
|
|
+ ExportExtension = "m3u8";
|
|
|
+ ExportMime = "text/mpegurl";
|
|
|
|
|
|
PlaylistId = playlistId;
|
|
|
-
|
|
|
StateHasChanged();
|
|
|
mdl.Show();
|
|
|
}
|
|
|
|
|
|
+ private void EncodingChanged(int value)
|
|
|
+ {
|
|
|
+ ExportCodePage = value;
|
|
|
+ ExportExtension =
|
|
|
+ ExportCodePage == 65001
|
|
|
+ ? "m3u8"
|
|
|
+ : "m3u";
|
|
|
+ StateHasChanged();
|
|
|
+ }
|
|
|
+
|
|
|
public void DoExport()
|
|
|
{
|
|
|
var encoding = Encoding.GetEncoding(ExportCodePage);
|
|
@@ -114,4 +141,7 @@
|
|
|
JSRuntime.InvokeVoidAsync("fnz.downloadFile", sbFn.ToString(), ExportMime, outBuf);
|
|
|
mdl.Hide();
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|