Skip to content

Commit 8a0a5e6

Browse files
authored
version: new version v2.0.0 (#16)
* chore: add dropdown button to channel name * feat: deleting shared feat: refresh after import feat: remember tab * chore: improves * feat: improve import shared files and folders * fix: solve anonymous tab issue * chore: avoid check certificate * chore: avoid add bad files and folders to upload * chore: improve count files on upload * chore: avoid directories * chore: not contains no sincronized folders * feat: video first step * chore: web video player * feat: bump to dot net 8 * fix: fix docker port * Update README.md
1 parent 300b06b commit 8a0a5e6

8 files changed

Lines changed: 82 additions & 18 deletions

File tree

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ services:
4242
depends_on:
4343
- mongodb_container
4444
ports:
45-
- "8015:80"
46-
- "8016:443"
45+
- "8015:8080"
4746
volumes:
4847
- <local folder/>:/app/local
4948
- <folder logs/>:/app/logs
@@ -99,6 +98,7 @@ services:
9998
- [Blazor Bootstrap](https://demos.blazorbootstrap.com/)
10099
- [WTelegramClient](https://github.com/wiz0u/WTelegramClient)
101100

101+
<!---
102102
103103
## Name
104104
@@ -120,8 +120,13 @@ services:
120120
121121
## Authors and acknowledgment
122122
123+
-->
123124

124125
## License
125126
- GPLv3
126127

128+
<!--
129+
127130
## Project status
131+
132+
-->

TelegramDownloader/Data/FileService.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,14 +1031,19 @@ public async Task AddUploadFileFromServer(string dbName, string currentPath, Lis
10311031
var fileInfo = new System.IO.FileInfo(currentFilePath);
10321032
if (!file.IsFile)
10331033
{
1034-
var allFiles = new DirectoryInfo(currentFilePath).GetFiles("*.*", SearchOption.AllDirectories).Where(x => !x.Attributes.HasFlag(FileAttributes.Hidden));
1034+
if (file.Name == "@eaDir") continue;
1035+
var allFiles = new DirectoryInfo(currentFilePath).GetFiles("*.*", SearchOption.AllDirectories).Where(x => !x.Attributes.HasFlag(FileAttributes.Hidden) && !x.Attributes.HasFlag(FileAttributes.Directory) && !x.FullName.Contains("@eaDir") && x.Length > 0);
10351036
idt.total += allFiles.Count();
10361037
idt.totalSize += allFiles.Sum(x => x.Length);
10371038
}
10381039
else
10391040
{
1040-
idt.total++;
1041-
idt.totalSize += fileInfo.Length;
1041+
if (file.Size > 0)
1042+
{
1043+
idt.total++;
1044+
idt.totalSize += fileInfo.Length;
1045+
}
1046+
10421047
}
10431048

10441049
}

TelegramDownloader/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
22

3-
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
3+
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
44
WORKDIR /app
55
EXPOSE 80
66
EXPOSE 443
77

8-
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
8+
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
99
ARG BUILD_CONFIGURATION=Release
1010
WORKDIR /src
1111
COPY ["TelegramDownloader.csproj", "."]
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<Modal @ref="modal" Title="Video" UseStaticBackdrop="true" CloseOnEscape="false" Size="ModalSize.ExtraLarge">
2+
<BodyTemplate>
3+
@if(!string.IsNullOrEmpty(fileUrl))
4+
{
5+
<video id="video-player"
6+
class="video-js"
7+
controls
8+
preload="auto"
9+
style="height: 100% !important; width: 100% !important"
10+
data-setup="{}">
11+
<source src=@fileUrl type="video/mp4" />
12+
<p class="vjs-no-js">
13+
To view this video please enable JavaScript, and consider upgrading to a
14+
web browser that
15+
<a href="https://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
16+
</p>
17+
</video>
18+
}
19+
20+
</BodyTemplate>
21+
<FooterTemplate>
22+
<Button Color="ButtonColor.Secondary" @onclick="OnHideModalClick">Close</Button>
23+
</FooterTemplate>
24+
</Modal>
25+
26+
27+
@code {
28+
public string fileUrl = "";
29+
30+
private Modal modal = default!;
31+
32+
public async Task ShowModal(string file)
33+
{
34+
fileUrl = file;
35+
await modal.ShowAsync();
36+
}
37+
38+
public async Task OnHideModalClick()
39+
{
40+
fileUrl = "";
41+
await modal.HideAsync();
42+
}
43+
}

TelegramDownloader/Pages/Partials/impl/LocalFileManagerImpl.razor

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
@inject ILogger<FileManager> Logger;
1111

1212

13+
1314
<SfFileManager @ref="FileManager" ID="localfm" TValue="FileManagerDirectoryContent">
1415
<FileManagerAjaxSettings Url=@($"/api/file/FileOperations")
1516
UploadUrl="/api/file/Upload"
@@ -27,6 +28,7 @@
2728
<TelegramDownloader.Pages.Modals.UploadToTelegramModal @ref="Modal"></TelegramDownloader.Pages.Modals.UploadToTelegramModal>
2829
<TelegramDownloader.Pages.Modals.FileUploadModal @ref="ModalUpSer"></TelegramDownloader.Pages.Modals.FileUploadModal>
2930
<TelegramDownloader.Pages.Modals.InfoModals.MediaUrlModal @ref="mediaUrlModal"></TelegramDownloader.Pages.Modals.InfoModals.MediaUrlModal>
31+
<TelegramDownloader.Pages.Modals.VideoPlayerModal @ref=videoPlayer></TelegramDownloader.Pages.Modals.VideoPlayerModal>
3032

3133

3234
@code {
@@ -39,6 +41,7 @@
3941
SfFileManager<FileManagerDirectoryContent>? FileManager;
4042

4143
private MediaUrlModal mediaUrlModal { get; set; } = default!;
44+
private VideoPlayerModal videoPlayer { get; set; } = default!;
4245

4346
NotificationModel nm = new NotificationModel();
4447
public string[] ContextItems = new string[] { "Open", "Delete", "Download", "Rename", "Details", "Copy Media Url" };
@@ -72,7 +75,7 @@
7275
Items.AddRange(new List<ToolBarItemModel>(){
7376
new ToolBarItemModel() { Name = "Upload File", Text = "Upload To Server", TooltipText = "Upload To server", PrefixIcon = "e-icons e-fe-upload" },
7477
new ToolBarItemModel() { Name = "UploadTelegram", Text = "Upload Telegram", TooltipText = "Upload File", PrefixIcon = "bi bi-telegram" },
75-
78+
7679
}
7780
);
7881
}
@@ -176,7 +179,17 @@
176179
// string localdir = "/" + FileService.STATICRELATIVELOCALDIR.Replace("\\", "/");
177180
// string path = Path.Combine(localdir, args.FileDetails.FilterPath.Substring(1).Replace("\\", "/"), args.FileDetails.Name);
178181
// await JSRuntime.InvokeVoidAsync("open", path, "_blank");
182+
} else
183+
{
184+
if (args != null && args.FileDetails != null && args.FileDetails.IsFile && new List<string> { ".mov", ".mp4", ".m4v", ".ogv", ".webm", ".flv", ".f4v" }.Contains(args.FileDetails.Type.ToLower()))
185+
{
186+
string localdir = MyNavigationManager.BaseUri + FileService.STATICRELATIVELOCALDIR.Replace("\\", "/");
187+
string path = new System.Uri((Path.Combine(localdir, args.FileDetails.FilterPath.Substring(1).Replace("\\", "/"), args.FileDetails.Name)).Replace("\\", "/")).AbsoluteUri;
188+
videoPlayer.ShowModal(path);
189+
}
190+
179191
}
192+
180193
}
181194

182195
private async Task playAudio(FileOpenEventArgs<FileManagerDirectoryContent> args)

TelegramDownloader/Pages/_Layout.cshtml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@
1919
<script src="https://cdn.syncfusion.com/blazor/25.1.35/syncfusion-blazor.min.js" type="text/javascript"></script>
2020
<link rel="stylesheet" href=" _content/Syncfusion.Blazor/styles/bootstrap5.css" />
2121
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
22-
22+
<link href="https://vjs.zencdn.net/8.16.1/video-js.css" rel="stylesheet" />
2323

24-
25-
26-
2724
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
2825
</head>
2926
<body>
@@ -57,6 +54,7 @@
5754
<script src="js/bootstrap5/popper.min.js"></script>
5855

5956
<script src="js/bshelp.js"></script>
57+
<script src="https://vjs.zencdn.net/8.16.1/video.min.js"></script>
6058

6159

6260
</body>

TelegramDownloader/Properties/launchSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"launchBrowser": true,
2222
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
2323
"environmentVariables": {
24-
"ASPNETCORE_URLS": "https://+:443;http://+:80"
24+
"ASPNETCORE_HTTP_PORTS": "https://+:443;http://+:80"
2525
},
2626
"publishAllPorts": true,
2727
"useSSL": true

TelegramDownloader/TelegramDownloader.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Version>0.0.0.0</Version>
55
<Authors>Mateo</Authors>
66
<Product>TelegramFileManager</Product>
7-
<TargetFramework>net6.0</TargetFramework>
7+
<TargetFramework>net8.0</TargetFramework>
88
<Nullable>enable</Nullable>
99
<ImplicitUsings>enable</ImplicitUsings>
1010
<UserSecretsId>528ba20b-8482-4c0f-9c2f-7ecc8dc30410</UserSecretsId>
@@ -13,14 +13,14 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="Blazor.Bootstrap" Version="3.1.1" />
16+
<PackageReference Include="Blazor.Bootstrap" Version="3.2.0" />
1717
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="8.0.0" />
1818
<PackageReference Include="MongoDB.Driver" Version="3.0.0" />
1919
<PackageReference Include="QRCoder" Version="1.6.0" />
20-
<PackageReference Include="Syncfusion.Blazor" Version="27.2.2" />
20+
<PackageReference Include="Syncfusion.Blazor" Version="27.2.4" />
2121
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
22-
<PackageReference Include="Syncfusion.EJ2.AspNet.Core" Version="27.2.2" />
23-
<PackageReference Include="WTelegramClient" Version="4.2.2" />
22+
<PackageReference Include="Syncfusion.EJ2.AspNet.Core" Version="27.2.4" />
23+
<PackageReference Include="WTelegramClient" Version="4.2.4" />
2424
</ItemGroup>
2525

2626
<ItemGroup>

0 commit comments

Comments
 (0)