Skip to content

Commit

Permalink
Update VideoPlayerView (#548)
Browse files Browse the repository at this point in the history
* Use `PropertyName`

* Use Azure Media Services Updated Streaming Formats

* Increase to v2.5.3

* Only Update VisibleRepositoriesCollection on Event when `RefreshState is RefreshState.Succeeded or RefreshState.Uninitialized`

* Update GitHubApiV3ServiceTests.cs

* Revert "Update GitHubApiV3ServiceTests.cs"

This reverts commit b5c21b8.
  • Loading branch information
brminnick authored Oct 9, 2022
1 parent c2fd5ea commit 78fb064
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion GitTrends.Android/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="56" android:versionName="2.5.2" package="com.minnick.gittrends" android:installLocation="auto">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="57" android:versionName="2.5.3" package="com.minnick.gittrends" android:installLocation="auto">
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="33" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<application android:label="GitTrends" android:fullBackupContent="@xml/auto_backup_rules">
Expand Down
4 changes: 2 additions & 2 deletions GitTrends.Shared/Models/StreamingUrl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ public record StreamingManifest
public StreamingManifest(string manifestUrl)
{
ManifestUrl = manifestUrl;
HlsUrl = manifestUrl + "(format=m3u8-aapl)";
DashUrl = manifestUrl + "(format=mpd-time-csf)";
HlsUrl = manifestUrl + "(format=m3u8-cmaf)";
DashUrl = manifestUrl + "(format=mpd-time-cmaf)";
}

public string ManifestUrl { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE
{
base.OnElementPropertyChanged(sender, e);

if (e.PropertyName is nameof(Element.Url)
if (e.PropertyName == VideoPlayerView.UrlProperty.PropertyName
&& _avPlayerViewController.View is not null
&& Element.Url is not null)
{
Expand Down
4 changes: 2 additions & 2 deletions GitTrends.iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@
<string>processing</string>
</array>
<key>CFBundleShortVersionString</key>
<string>2.5.2</string>
<string>2.5.3</string>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>com.minnick.GitTrends.NotifyTrendingRepositories</string>
<string>com.minnick.GitTrends.CleanUpDatabase</string>
</array>
<key>CFBundleVersion</key>
<string>56</string>
<string>57</string>
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
Expand Down
13 changes: 8 additions & 5 deletions GitTrends/ViewModels/RepositoryViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public partial class RepositoryViewModel : BaseViewModel
readonly GitHubApiRepositoriesService _gitHubApiRepositoriesService;

IReadOnlyList<Repository> _repositoryList = Array.Empty<Repository>();
RefreshState _refreshState;

[ObservableProperty]
bool _isRefreshing;
Expand Down Expand Up @@ -102,10 +103,12 @@ public static event EventHandler<PullToRefreshFailedEventArgs> PullToRefreshFail

RefreshState RefreshState
{
get => _refreshState;
set
{
EmptyDataViewTitle = EmptyDataViewService.GetRepositoryTitleText(value, !_repositoryList.Any());
EmptyDataViewDescription = EmptyDataViewService.GetRepositoryDescriptionText(value, !_repositoryList.Any());
_refreshState = value;
}
}

Expand Down Expand Up @@ -201,8 +204,8 @@ async Task ExecuteRefresh()
AddRepositoriesToCollection(repositoriesFromDatabaseThatDontRequireUpdating, _searchBarText, duplicateRepositoryPriorityFilter: x => x.ContainsViewsClonesStarsData);


var repositoriesWithoutStarsDataAndOver1000Stars = _repositoryList.Where(x => !x.ContainsViewsClonesStarsData && x.StarCount > 1000);
var repositoriesWithoutStarsDataAndLessThan1000Stars = _repositoryList.Where(x => !x.ContainsViewsClonesStarsData && x.StarCount <= 1000);
var repositoriesWithoutStarsDataAndOver1000Stars = _repositoryList.Where(x => !x.ContainsStarsData && x.StarCount > 1000);
var repositoriesWithoutStarsDataAndLessThan1000Stars = _repositoryList.Where(x => !x.ContainsStarsData && x.StarCount <= 1000);

// Fetch Stars Data in Background for Repositories Containing Over 1000 Stars
// GitHub API limits us to 100 StarGazers per Request, meaning that a repository with 24K Stars requires 240 round-trips from GitTrends to GitHub's servers to aggregate the data
Expand Down Expand Up @@ -498,8 +501,8 @@ void OnPullToRefreshFailed(PullToRefreshFailedEventArgs pullToRefreshFailedEvent
_pullToRefreshFailedEventManager.RaiseEvent(this, pullToRefreshFailedEventArgs, nameof(PullToRefreshFailed));
}

void HandleScheduleRetryRepositoriesStarsCompleted(object sender, Repository e) => AddRepositoriesToCollection(new Repository[] { e }, _searchBarText, duplicateRepositoryPriorityFilter: x => x.ContainsViewsClonesStarsData);
void HandleTrendsViewModelRepositorySavedToDatabase(object sender, Repository e) => AddRepositoriesToCollection(new Repository[] { e }, _searchBarText, duplicateRepositoryPriorityFilter: x => x.ContainsViewsClonesStarsData);
void HandleScheduleRetryRepositoriesViewsClonesStarsCompleted(object sender, Repository e) => AddRepositoriesToCollection(new Repository[] { e }, _searchBarText, duplicateRepositoryPriorityFilter: x => x.ContainsViewsClonesStarsData);
void HandleScheduleRetryRepositoriesStarsCompleted(object sender, Repository e) => AddRepositoriesToCollection(new Repository[] { e }, _searchBarText, RefreshState is RefreshState.Succeeded or RefreshState.Uninitialized, x => x.ContainsViewsClonesStarsData);
void HandleTrendsViewModelRepositorySavedToDatabase(object sender, Repository e) => AddRepositoriesToCollection(new Repository[] { e }, _searchBarText, RefreshState is RefreshState.Succeeded or RefreshState.Uninitialized, x => x.ContainsViewsClonesStarsData);
void HandleScheduleRetryRepositoriesViewsClonesStarsCompleted(object sender, Repository e) => AddRepositoriesToCollection(new Repository[] { e }, _searchBarText, RefreshState is RefreshState.Succeeded or RefreshState.Uninitialized, x => x.ContainsViewsClonesStarsData);
}
}

0 comments on commit 78fb064

Please sign in to comment.