Skip to content

Commit

Permalink
Added the open on mobile back in, this will be available in the next …
Browse files Browse the repository at this point in the history
…app update
  • Loading branch information
tidusjar committed May 7, 2021
1 parent 8dd00e9 commit 4071b2e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static class AvailabilityRuleHelper
{
public static void CheckForUnairedEpisodes(SearchTvShowViewModel search)
{
foreach (var season in search.SeasonRequests)
foreach (var season in search.SeasonRequests.ToList())
{
// If we have all the episodes for this season, then this season is available
if (season.Episodes.All(x => x.Available))
Expand Down
4 changes: 2 additions & 2 deletions src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ public async Task<RuleResult> Execute(SearchViewModel obj)
if (search.SeasonRequests.Any())
{
var allEpisodes = PlexContentRepository.GetAllEpisodes();
foreach (var season in search.SeasonRequests)
foreach (var season in search.SeasonRequests.ToList())
{
foreach (var episode in season.Episodes)
foreach (var episode in season.Episodes.ToList())
{
await AvailabilityRuleHelper.SingleEpisodeCheck(useImdb, allEpisodes, episode, season, item, useTheMovieDb, useTvDb, Log);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,25 @@ <h2 id="usernameTitle">{{username}}
<div style="margin-left:4%" class="col-12 col-sm-6 col-xl-5">
<mat-label [translate]="'UserPreferences.MobileQRCode'"></mat-label>
<div id="noQrCode" *ngIf="!qrCodeEnabled" [translate]="'UserPreferences.NoQrCode'"></div>
<div class="row">
<qrcode id="qrCode" *ngIf="qrCodeEnabled" [qrdata]="qrCode" [size]="256" [level]="'L'"></qrcode>
<div class="row">
<div class="col-12">
<a href='https://play.google.com/store/apps/details?id=com.tidusjar.Ombi&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'
target="_blank"><img width="200px" alt='Get it on Google Play'
src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png' /></a>
<qrcode id="qrCode" *ngIf="qrCodeEnabled" [qrdata]="qrCode" [size]="256" [level]="'L'"></qrcode>
<div class="row">
<div class="col-12">
<a href='https://play.google.com/store/apps/details?id=com.tidusjar.Ombi&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'
target="_blank"><img width="200px" alt='Get it on Google Play'
src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png' /></a>
</div>
<div class="col-12">
<a href='https://apps.apple.com/us/app/ombi/id1335260043' target="_blank"><img
style="margin-left:13px" width="170px" alt='Get it on Google Play'
src='../../../images/appstore.svg' /></a>
</div>
<div class="col-12">
<button style="margin-left:13px; margin-top: 20px;" mat-raised-button color="accent" type="button" (click)="openMobileApp($event)">Open Mobile App</button>
</div>
</div>
</div>
<div class="col-12">
<a href='https://apps.apple.com/us/app/ombi/id1335260043' target="_blank"><img style="margin-left:13px" width="170px"
alt='Get it on Google Play' src='../../../images/appstore.svg' /></a>
</div></div>
</div></div>
</div>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ export class UserPreferenceComponent implements OnInit {
})
}

public openMobileApp(event: any) {
event.preventDefault();

const url = `ombi://${this.qrCode}`;
window.location.assign(url);
}


private welcomeText: string;
private setWelcomeText() {
Expand Down

0 comments on commit 4071b2e

Please sign in to comment.