Skip to content

Commit 57cb282

Browse files
[+] Download skipper component (WIP)
1 parent 5d4dc7c commit 57cb282

File tree

3 files changed

+11
-100
lines changed

3 files changed

+11
-100
lines changed

ProxyMov_DownloadServer/Components/DownloadQueComponent.razor

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
<tbody>
2222
@if (Downloads is not null)
2323
{
24-
int i = 1;
25-
24+
int i = 1;
2625
@foreach (EpisodeDownloadModel download in Downloads.Take(VisibleQueueEntriesCount))
2726
{
2827
@if (i == 1)

ProxyMov_DownloadServer/Components/DownloadSkipperComponent.razor

Lines changed: 9 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -5,95 +5,27 @@
55
{
66
string seriesName = group.First().Download.Name;
77
var seasonGroups = group.GroupBy(_ => _.Download.Season);
8-
<h5 class="d-inline-block me-2">
8+
<div class="d-inline-block me-2 mb-2">
99
<HxBadge CssClass="px-3 pt-2 pb-2" Color="ThemeColor.Secondary">
10-
<div class="d-block">
11-
<span class="d-block mb-2 text-warning">@seriesName</span>
12-
<div class="d-flex justify-content-center">
13-
@foreach (IGrouping<int, EpisodeDownloadModel> group2 in seasonGroups)
14-
{
15-
<HxBadge CssClass="d-inline-block px-3 mx-1" Type="BadgeType.RoundedPill" Color="ThemeColor.Dark">
16-
@($"S{group2.Key:D2}")
17-
</HxBadge>
18-
}
19-
</div>
20-
</div>
21-
</HxBadge>
22-
</h5>
23-
}
24-
</div>
25-
<div class="container mt-5 text-center">
26-
@foreach (IGrouping<string, EpisodeDownloadModel> group in GetGroupedDownloads())
27-
{
28-
string seriesName = group.First().Download.Name;
29-
var seasonGroups = group.GroupBy(_ => _.Download.Season);
30-
<h5 class="d-inline-block me-2">
31-
<HxBadge CssClass="px-3 pt-2 pb-2" Color="ThemeColor.Secondary">
32-
<div class="d-block">
33-
<span class="d-block mb-2 pb-2 text-warning border-bottom border-2 border-dark-subtle mx-1">@seriesName</span>
34-
<div class="d-flex justify-content-center">
35-
@foreach (IGrouping<int, EpisodeDownloadModel> group2 in seasonGroups)
36-
{
37-
<HxBadge CssClass="d-inline-block px-3 mx-1" Type="BadgeType.RoundedPill" Color="ThemeColor.Dark">
38-
@($"S{group2.Key:D2}")
39-
</HxBadge>
40-
}
41-
</div>
42-
</div>
43-
</HxBadge>
44-
</h5>
45-
}
46-
</div>
47-
<div class="container mt-5 text-center">
48-
@foreach (IGrouping<string, EpisodeDownloadModel> group in GetGroupedDownloads())
49-
{
50-
string seriesName = group.First().Download.Name;
51-
var seasonGroups = group.GroupBy(_ => _.Download.Season);
52-
<h5 class="d-inline-block me-2">
53-
<HxBadge CssClass="px-3 pt-2 pb-2" Color="ThemeColor.Secondary">
54-
<div class="d-block">
10+
<div class="d-block" style="min-width: 250px">
5511
<h5>
5612
<HxBadge CssClass="w-100 py-2" Type="BadgeType.RoundedPill" Color="ThemeColor.Warning">
57-
@seriesName
58-
</HxBadge>
59-
</h5>
60-
<div class="d-flex justify-content-center">
61-
@foreach (IGrouping<int, EpisodeDownloadModel> group2 in seasonGroups)
62-
{
63-
<HxBadge CssClass="d-inline-block px-3 mx-1" Type="BadgeType.RoundedPill" Color="ThemeColor.Dark">
64-
@($"S{group2.Key:D2}")
65-
</HxBadge>
66-
}
67-
</div>
68-
</div>
69-
</HxBadge>
70-
</h5>
71-
}
72-
</div>
73-
<div class="container mt-5 text-center">
74-
@foreach (IGrouping<string, EpisodeDownloadModel> group in GetGroupedDownloads())
75-
{
76-
string seriesName = group.First().Download.Name;
77-
var seasonGroups = group.GroupBy(_ => _.Download.Season);
78-
<h5 class="d-inline-block me-2">
79-
<HxBadge CssClass="px-3 pt-2 pb-2" Color="ThemeColor.Secondary">
80-
<div class="d-block">
81-
<h5>
82-
<HxBadge CssClass="w-100 py-2" Type="BadgeType.RoundedPill" Color="ThemeColor.Success">
83-
@seriesName
13+
<span class="pe-3 align-middle">@seriesName</span>
14+
<HxIcon CssClass="text-danger float-end fs-5" Icon="BootstrapIcon.XCircle"></HxIcon>
8415
</HxBadge>
8516
</h5>
8617
<div class="d-flex justify-content-center">
8718
@foreach (IGrouping<int, EpisodeDownloadModel> group2 in seasonGroups)
8819
{
89-
<HxBadge CssClass="d-inline-block px-3 mx-1" Type="BadgeType.RoundedPill" Color="ThemeColor.Dark">
90-
@($"S{group2.Key:D2}")
20+
<HxBadge style="font-size: 15px" CssClass="d-inline-block px-3 mx-1" Type="BadgeType.RoundedPill" Color="ThemeColor.Dark">
21+
<span class="pe-3">@($"S{group2.Key:D2}")</span>
22+
<HxIcon CssClass="text-danger float-end" Icon="BootstrapIcon.XCircle"></HxIcon>
9123
</HxBadge>
9224
}
9325
</div>
9426
</div>
9527
</HxBadge>
96-
</h5>
28+
</div>
9729
}
9830
</div>
9931
}
@@ -102,27 +34,6 @@
10234
private List<EpisodeDownloadModel>? Downloads { get; set; } = [];
10335
private CronJobState CronJobState = CronJobState.WaitForNextCycle;
10436

105-
private List<EpisodeDownloadModel>? MockDownloads { get; set; } = new()
106-
{
107-
new EpisodeDownloadModel(){ Download = new DownloadModel() { Name = "Jujutsu Kaisen", Season = 1, Episode = 1 } },
108-
new EpisodeDownloadModel(){ Download = new DownloadModel() { Name = "Jujutsu Kaisen", Season = 2, Episode = 1 } },
109-
new EpisodeDownloadModel(){ Download = new DownloadModel() { Name = "Jujutsu Kaisen", Season = 3, Episode = 1 } },
110-
new EpisodeDownloadModel(){ Download = new DownloadModel() { Name = "Mushoku Tensei: Jobless Reincarnation", Season = 1, Episode = 1 } },
111-
new EpisodeDownloadModel(){ Download = new DownloadModel() { Name = "Mushoku Tensei: Jobless Reincarnation", Season = 2, Episode = 1 } },
112-
new EpisodeDownloadModel(){ Download = new DownloadModel() { Name = "Date a Live", Season = 1, Episode = 1 } },
113-
new EpisodeDownloadModel(){ Download = new DownloadModel() { Name = "Date a Live", Season = 2, Episode = 1 } },
114-
new EpisodeDownloadModel(){ Download = new DownloadModel() { Name = "Black Clover", Season = 1, Episode = 1 } },
115-
new EpisodeDownloadModel(){ Download = new DownloadModel() { Name = "Black Clover", Season = 2, Episode = 1 } },
116-
new EpisodeDownloadModel(){ Download = new DownloadModel() { Name = "Beyblade X", Season = 1, Episode = 1 } },
117-
new EpisodeDownloadModel(){ Download = new DownloadModel() { Name = "Beyblade X", Season = 2, Episode = 1 } },
118-
new EpisodeDownloadModel(){ Download = new DownloadModel() { Name = "Beyblade Y", Season = 1, Episode = 1 } },
119-
new EpisodeDownloadModel(){ Download = new DownloadModel() { Name = "Beyblade Y", Season = 2, Episode = 1 } },
120-
new EpisodeDownloadModel(){ Download = new DownloadModel() { Name = "Beyblade Z", Season = 1, Episode = 1 } },
121-
new EpisodeDownloadModel(){ Download = new DownloadModel() { Name = "Beyblade Z", Season = 2, Episode = 1 } },
122-
new EpisodeDownloadModel(){ Download = new DownloadModel() { Name = "The Eminence in Shadow", Season = 1, Episode = 1 } },
123-
new EpisodeDownloadModel(){ Download = new DownloadModel() { Name = "The Eminence in Shadow", Season = 2, Episode = 1 } },
124-
};
125-
12637
protected override void OnAfterRender(bool firstRender)
12738
{
12839
if (firstRender)
@@ -163,6 +74,6 @@
16374

16475
private IEnumerable<IGrouping<string, EpisodeDownloadModel>> GetGroupedDownloads()
16576
{
166-
return MockDownloads.GroupBy(_ => _.Download.Name);
77+
return Downloads.GroupBy(_ => _.Download.Name).Take(5);
16778
}
16879
}

ProxyMov_DownloadServer/Components/Pages/DashboardPage.razor

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@
358358
}
359359
</div>
360360
</div>
361+
<DownloadSkipperComponent></DownloadSkipperComponent>
361362
<DownloadQueComponent OnDownloadSkippOrRemove="@OnDownloadSkipped"></DownloadQueComponent>
362363
</div>
363364

0 commit comments

Comments
 (0)