Skip to content

Commit 1529a84

Browse files
committed
feat: improvements in playlist
1 parent 000c7e1 commit 1529a84

5 files changed

Lines changed: 114 additions & 7 deletions

File tree

TelegramDownloader/Data/TelegramService.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ public async Task<string> checkAuth(string number, bool isPhone = false)
259259
}
260260
try
261261
{
262+
if (number == null)
263+
return "phone";
262264
return await DoLogin(number);
263265
}
264266
catch (Exception ex)

TelegramDownloader/Models/GeneralConfig.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ public class TLConfig
120120
public string? hash_id { get; set;}
121121
public string? mongo_connection_string { get; set; }
122122
public bool? avoid_checking_certificate { get; set; }
123+
public bool? open_browser_on_startup { get; set; }
123124
}
124125

125126
public class WebDavModel

TelegramDownloader/Pages/Modals/AudioPlayerModal.razor

Lines changed: 107 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,27 @@
672672
background: rgba(0, 0, 0, 0.2);
673673
}
674674
675+
/* Expanded mode - show more tracks */
676+
.audio-player-content.expanded {
677+
display: flex;
678+
flex-direction: column;
679+
height: 100%;
680+
}
681+
682+
.audio-player-content.expanded .playlist-section {
683+
flex: 1;
684+
display: flex;
685+
flex-direction: column;
686+
min-height: 0;
687+
overflow: hidden;
688+
}
689+
690+
.audio-player-content.expanded .audio-playlist {
691+
flex: 1;
692+
max-height: none !important;
693+
overflow-y: auto;
694+
}
695+
675696
.audio-playlist::-webkit-scrollbar {
676697
width: 6px;
677698
}
@@ -873,12 +894,27 @@
873894
}
874895
875896
.audio-player-sidebar {
876-
display: none;
897+
display: none !important;
898+
}
899+
900+
.audio-player-main {
901+
height: 100%;
902+
max-height: 100%;
903+
overflow: hidden;
877904
}
878905
879906
.audio-player-content {
880907
padding: 1rem;
881908
padding-top: 3rem;
909+
height: 100%;
910+
max-height: 100%;
911+
box-sizing: border-box;
912+
}
913+
914+
/* Avoid overlap with close button */
915+
.current-playlist-badge {
916+
margin-right: 3rem;
917+
max-width: calc(100% - 3.5rem);
882918
}
883919
884920
.album-art {
@@ -917,6 +953,7 @@
917953
918954
.audio-playlist {
919955
max-height: 35vh;
956+
padding-bottom: 1rem;
920957
}
921958
922959
.audio-volume-container {
@@ -1005,13 +1042,79 @@
10051042
margin-top: 0.5rem;
10061043
}
10071044
1008-
.audio-player-content.expanded .audio-playlist {
1009-
max-height: calc(100vh - 280px);
1045+
@@media (min-width: 769px) {
1046+
.audio-player-content.expanded {
1047+
overflow: hidden;
1048+
padding: 0.75rem;
1049+
}
1050+
1051+
.audio-player-content.expanded .compact-now-playing {
1052+
padding: 0.35rem 0.5rem;
1053+
margin-bottom: 0.35rem;
1054+
}
1055+
1056+
.audio-player-content.expanded .audio-controls {
1057+
padding: 0.5rem;
1058+
}
1059+
1060+
.audio-player-content.expanded .playlist-section {
1061+
display: flex;
1062+
flex-direction: column;
1063+
margin-top: 0.25rem;
1064+
}
1065+
1066+
.audio-player-content.expanded .queue-header-row {
1067+
flex-shrink: 0;
1068+
padding-bottom: 0.25rem;
1069+
}
1070+
1071+
.audio-player-content.expanded .audio-playlist {
1072+
flex: 1;
1073+
min-height: 0;
1074+
max-height: calc(90vh - 200px);
1075+
overflow-y: auto;
1076+
}
1077+
1078+
.audio-player-content.expanded .playlist-item {
1079+
padding: 0.4rem 0.5rem;
1080+
}
10101081
}
10111082
10121083
@@media (max-width: 768px) {
1084+
.audio-player-content.expanded {
1085+
overflow: hidden;
1086+
display: flex;
1087+
flex-direction: column;
1088+
}
1089+
1090+
.audio-player-content.expanded .compact-now-playing {
1091+
flex: 0 0 auto;
1092+
}
1093+
1094+
.audio-player-content.expanded .audio-controls {
1095+
flex: 0 0 auto;
1096+
}
1097+
1098+
.audio-player-content.expanded .playlist-section {
1099+
flex: 1 1 0;
1100+
min-height: 0;
1101+
display: flex;
1102+
flex-direction: column;
1103+
overflow: hidden;
1104+
}
1105+
1106+
.audio-player-content.expanded .queue-header-row {
1107+
flex: 0 0 auto;
1108+
margin-bottom: 0.5rem;
1109+
}
1110+
10131111
.audio-player-content.expanded .audio-playlist {
1014-
max-height: calc(100vh - 220px);
1112+
flex: 1 1 0;
1113+
min-height: 0;
1114+
max-height: none;
1115+
overflow-y: auto;
1116+
-webkit-overflow-scrolling: touch;
1117+
padding-bottom: 1rem;
10151118
}
10161119
}
10171120

TelegramDownloader/Program.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,9 @@
303303

304304
Log.Information("TelegramFileManager application started. Listening on: {Urls}", string.Join(", ", listeningUrls));
305305

306-
// Open browser automatically if not in Docker
307-
if (!isDocker && listeningUrls.Any())
306+
// Open browser automatically if not in Docker and not disabled in config
307+
var shouldOpenBrowser = GeneralConfigStatic.tlconfig?.open_browser_on_startup ?? true;
308+
if (!isDocker && shouldOpenBrowser && listeningUrls.Any())
308309
{
309310
var urlToOpen = listeningUrls.FirstOrDefault(u => u.StartsWith("http://")) ?? listeningUrls.First();
310311

TelegramDownloader/TelegramDownloader.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<Version>3.2.0.0</Version>
4+
<Version>3.3.0.0</Version>
55
<Authors>Mateo</Authors>
66
<Product>TelegramFileManager</Product>
77
<TargetFramework>net10.0</TargetFramework>

0 commit comments

Comments
 (0)