Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
insomniachi committed Aug 27, 2022

Verified

This commit was signed with the committer’s verified signature.
JasonGrace2282 Aarush Deshpande
1 parent 0168ca1 commit d3126b9
Showing 7 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions AnimDL.UI.Core/Models/WeeklyScheduleModel.cs
Original file line number Diff line number Diff line change
@@ -25,6 +25,6 @@ public ScheduleModel this[DayOfWeek day]
};
}

public IEnumerable<ScheduleModel> ToList() =>
new List<ScheduleModel> { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday }.Where(x => x.Count > 0);
public List<ScheduleModel> ToList() =>
new List<ScheduleModel> { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday }.Where(x => x.Count > 0).ToList();
}
5 changes: 3 additions & 2 deletions AnimDL.UI.Core/ViewModels/ScheduleViewModel.cs
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@ public ScheduleViewModel(ITrackingService trackingService)
}

[Reactive] public ScheduleModel SelectedDay { get; set; }
[Reactive] public List<ScheduleModel> WeeklySchedule { get; set; } = new();
public ReadOnlyObservableCollection<ScheduledAnimeModel> Anime => _anime;
public WeeklyScheduleModel Schedule { get; } = new();
public DayOfWeek Filter => _filter.Value;
@@ -50,9 +51,9 @@ public Task SetInitialState()
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(list =>
{
WeeklySchedule = Schedule.ToList();
this.RaisePropertyChanged(nameof(Schedule));
var schedule = Schedule.ToList();
SelectedDay = schedule.FirstOrDefault(x => x.Day == DateTime.Today.DayOfWeek.ToString().ToLower()) ?? schedule.FirstOrDefault();
SelectedDay = WeeklySchedule.FirstOrDefault(x => x.Day == DateTime.Today.DayOfWeek.ToString().ToLower()) ?? WeeklySchedule.FirstOrDefault();
_animeCache.Edit(x => x.AddOrUpdate(list));
});

1 change: 1 addition & 0 deletions AnimDL.UI.Core/ViewModels/WatchViewModel.cs
Original file line number Diff line number Diff line change
@@ -93,6 +93,7 @@ public WatchViewModel(IProviderFactory providerFactory,
case WebMessageType.Pause:
observable.Where(_ => settings.UseDiscordRichPresense)
.Do(_ => discordRichPresense.UpdateDetails("Paused"))
.Do(_ => discordRichPresense.UpdateState(""))
.Do(_ => discordRichPresense.ClearTimer())
.Subscribe().DisposeWith(Garbage);
break;
2 changes: 1 addition & 1 deletion AnimDL.WinUI/Helpers/VideoJsHelper.cs
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ public class VideoJsHelper
</head>
<body>
<video id = ""my_video_1"" class=""video-js vjs-fluid vjs-default-skin vjs-fill vjs-big-play-centered"" controls autoplay preload=""auto"">
<video id = ""my_video_1"" class=""video-js vjs-default-skin vjs-fill vjs-big-play-centered"" controls autoplay preload=""auto"">
<source src = ""{0}"" type=""application/x-mpegURL"">
</video>
5 changes: 4 additions & 1 deletion AnimDL.WinUI/UserControls/AnimeCard.xaml
Original file line number Diff line number Diff line change
@@ -33,7 +33,10 @@
<Grid.Background>
<SolidColorBrush Opacity="0.5" Color="Black" />
</Grid.Background>
<TextBlock x:Name="NextEpisodeInText" FontSize="20" />
<TextBlock
x:Name="NextEpisodeInText"
FontSize="20"
Foreground="White" />
</Grid>

<Border
2 changes: 1 addition & 1 deletion AnimDL.WinUI/Views/SchedulePage.xaml
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@

<ListBox
HorizontalAlignment="Center"
ItemsSource="{x:Bind ViewModel.Schedule.ToList(), Mode=OneWay}"
ItemsSource="{x:Bind ViewModel.WeeklySchedule, Mode=OneWay}"
SelectedItem="{x:Bind ViewModel.SelectedDay, Mode=TwoWay}">
<ListBox.ItemTemplate>
<DataTemplate x:DataType="model:ScheduleModel">
7 changes: 3 additions & 4 deletions AnimDL.WinUI/Views/SettingsPage.xaml
Original file line number Diff line number Diff line change
@@ -65,16 +65,15 @@
OffContent=""
OnContent="" />
</labs:SettingsCard>
<labs:SettingsCard
<!--<labs:SettingsCard
Description="Default provider used to stream."
Header="Default Stream Provider"
Icon="&#xe93e;"
IsEnabled="False">
Icon="&#xe93e;">
<ComboBox
Width="150"
ItemsSource="{x:Bind ViewModel.ProviderTypes}"
SelectedItem="{x:Bind ViewModel.DefaultProviderType, Mode=TwoWay}" />
</labs:SettingsCard>
</labs:SettingsCard>-->
<labs:SettingsCard
Description="Let discord know what anime you're watching."
Header="Use discord rich presense"

0 comments on commit d3126b9

Please sign in to comment.