Merge branch 'develop' into feature/tvmaze-replacement

pull/4104/head
tidusjar 4 years ago
commit 8368877c74

@ -0,0 +1,57 @@
name: Automation Tests
on:
push:
branches: [ develop, feature/** ]
pull_request:
branches: [ develop ]
schedule:
- cron: '0 0 * * *'
jobs:
automation-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- uses: actions/setup-node@v2
with:
node-version: '14'
- uses: actions/cache@v2
with:
path: |
'**/node_modules'
'/home/runner/.cache/Cypress'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install Frontend Deps
run: yarn --cwd ./src/Ombi/ClientApp install
- name: Install Automation Deps
run: yarn --cwd ./tests install
- name: Start Backend
run: |
nohup dotnet run -p ./src/Ombi -- --host http://*:3577 &
- name: Start Frontend
run: |
nohup yarn --cwd ./src/Ombi/ClientApp start &
- name: Cypress Tests
uses: cypress-io/github-action@v2.8.2
with:
record: true
browser: chrome
headless: true
working-directory: tests
wait-on: http://localhost:3577/
# 7 minutes
wait-on-timeout: 420
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

@ -6,6 +6,7 @@ ____
[![Github All Releases](https://img.shields.io/github/downloads/tidusjar/Ombi/total.svg)](https://github.com/ombi-app/Ombi)
[![firsttimersonly](http://img.shields.io/badge/first--timers--only-friendly-blue.svg)](http://www.firsttimersonly.com/)
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/ombi/localized.svg)](https://crowdin.com/project/ombi)
[![Automation Tests](https://github.com/Ombi-app/Ombi/actions/workflows/cypress.yml/badge.svg)](https://github.com/Ombi-app/Ombi/actions/workflows/cypress.yml)
[![Patreon](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://patreon.com/tidusjar/Ombi)
[![Paypal](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://paypal.me/PlexRequestsNet)

@ -0,0 +1,81 @@
using Microsoft.EntityFrameworkCore;
using Ombi.Store.Entities.Requests;
using Ombi.Store.Repository;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace Ombi.Core.Engine.V2
{
public interface IIssuesEngine
{
Task<IEnumerable<IssuesSummaryModel>> GetIssues(int position, int take, IssueStatus status, CancellationToken token);
Task<IssuesSummaryModel> GetIssuesByProviderId(string providerId, CancellationToken token);
}
public class IssuesEngine : IIssuesEngine
{
private readonly IRepository<IssueCategory> _categories;
private readonly IRepository<Issues> _issues;
private readonly IRepository<IssueComments> _comments;
public IssuesEngine(IRepository<IssueCategory> categories,
IRepository<Issues> issues,
IRepository<IssueComments> comments)
{
_categories = categories;
_issues = issues;
_comments = comments;
}
public async Task<IEnumerable<IssuesSummaryModel>> GetIssues(int position, int take, IssueStatus status, CancellationToken token)
{
var issues = await _issues.GetAll().Where(x => x.Status == status && x.ProviderId != null).Skip(position).Take(take).OrderBy(x => x.Title).ToListAsync(token);
var grouped = issues.GroupBy(x => x.Title, (key, g) => new { Title = key, Issues = g });
var model = new List<IssuesSummaryModel>();
foreach(var group in grouped)
{
model.Add(new IssuesSummaryModel
{
Count = group.Issues.Count(),
Title = group.Title,
ProviderId = group.Issues.FirstOrDefault()?.ProviderId
});
}
return model;
}
public async Task<IssuesSummaryModel> GetIssuesByProviderId(string providerId, CancellationToken token)
{
var issues = await _issues.GetAll().Include(x => x.Comments).ThenInclude(x => x.User).Include(x => x.UserReported).Include(x => x.IssueCategory).Where(x => x.ProviderId == providerId).ToListAsync(token);
var grouped = issues.GroupBy(x => x.Title, (key, g) => new { Title = key, Issues = g }).FirstOrDefault();
if (grouped == null)
{
return null;
}
return new IssuesSummaryModel
{
Count = grouped.Issues.Count(),
Title = grouped.Title,
ProviderId = grouped.Issues.FirstOrDefault()?.ProviderId,
Issues = grouped.Issues
};
}
}
public class IssuesSummaryModel
{
public string Title { get; set; }
public int Count { get; set; }
public string ProviderId { get; set; }
public IEnumerable<Issues> Issues { get; set; }
}
}

@ -63,7 +63,8 @@ namespace Ombi.Core.Engine.V2
var result = new MultiSearchResult
{
MediaType = multiSearch.media_type,
Poster = multiSearch.poster_path
Poster = multiSearch.poster_path,
Overview = multiSearch.overview
};
if (multiSearch.media_type.Equals("movie", StringComparison.InvariantCultureIgnoreCase) && filter.Movies)

@ -6,5 +6,6 @@
public string MediaType { get; set; }
public string Title { get; set; }
public string Poster { get; set; }
public string Overview { get; set; }
}
}

@ -2,6 +2,7 @@
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Ombi.Core.Models.Search;
using Ombi.Helpers;
using Ombi.Store.Context;
using Ombi.Store.Entities;
using Ombi.Store.Entities.Requests;
@ -53,8 +54,13 @@ namespace Ombi.Core.Rule.Rules
if (obj.Type == RequestType.TvShow)
{
var vm = (SearchTvShowViewModel) obj;
// Check if it's in Radarr
var result = await _ctx.SonarrCache.FirstOrDefaultAsync(x => x.TvDbId.ToString() == vm.TheTvDbId);
// Check if it's in Sonarr
if (!vm.TheTvDbId.HasValue())
{
return new RuleResult { Success = true };
}
var tvdbidint = int.Parse(vm.TheTvDbId);
var result = await _ctx.SonarrCache.FirstOrDefaultAsync(x => x.TvDbId == tvdbidint);
if (result != null)
{
vm.Approved = true;
@ -69,7 +75,7 @@ namespace Ombi.Core.Rule.Rules
// Check if we have it
var monitoredInSonarr = await sonarrEpisodes.FirstOrDefaultAsync(x =>
x.EpisodeNumber == ep.EpisodeNumber && x.SeasonNumber == season.SeasonNumber
&& x.TvDbId.ToString() == vm.TheTvDbId);
&& x.TvDbId == tvdbidint);
if (monitoredInSonarr != null)
{
ep.Approved = true;

@ -114,6 +114,7 @@ namespace Ombi.DependencyInjection
services.AddTransient<ITVSearchEngineV2, TvSearchEngineV2>();
services.AddTransient<ICalendarEngine, CalendarEngine>();
services.AddTransient<IMusicSearchEngineV2, MusicSearchEngineV2>();
services.AddTransient<IIssuesEngine, IssuesEngine>();
}
public static void RegisterHttp(this IServiceCollection services)

@ -131,7 +131,7 @@ namespace Ombi.Notifications.Agents
};
// Send to user
var playerIds = GetUsers(model, NotificationType.IssueResolved);
var playerIds = await GetUsers(model, NotificationType.IssueResolved);
await Send(playerIds, notification, settings, model);
}
@ -172,7 +172,7 @@ namespace Ombi.Notifications.Agents
};
// Send to user
var playerIds = GetUsers(model, NotificationType.RequestDeclined);
var playerIds = await GetUsers(model, NotificationType.RequestDeclined);
await AddSubscribedUsers(playerIds);
await Send(playerIds, notification, settings, model);
}
@ -192,7 +192,7 @@ namespace Ombi.Notifications.Agents
};
// Send to user
var playerIds = GetUsers(model, NotificationType.RequestApproved);
var playerIds = await GetUsers(model, NotificationType.RequestApproved);
await AddSubscribedUsers(playerIds);
await Send(playerIds, notification, settings, model);
@ -215,7 +215,7 @@ namespace Ombi.Notifications.Agents
Data = data
};
// Send to user
var playerIds = GetUsers(model, NotificationType.RequestAvailable);
var playerIds = await GetUsers(model, NotificationType.RequestAvailable);
await AddSubscribedUsers(playerIds);
await Send(playerIds, notification, settings, model);
@ -285,19 +285,23 @@ namespace Ombi.Notifications.Agents
return playerIds;
}
private List<string> GetUsers(NotificationOptions model, NotificationType type)
private async Task<List<string>> GetUsers(NotificationOptions model, NotificationType type)
{
var notificationIds = new List<NotificationUserId>();
var notificationIds = new List<MobileDevices>();
if (MovieRequest != null || TvRequest != null)
{
notificationIds = model.RequestType == RequestType.Movie
? MovieRequest?.RequestedUser?.NotificationUserIds
: TvRequest?.RequestedUser?.NotificationUserIds;
var userId = model.RequestType == RequestType.Movie
? MovieRequest?.RequestedUser?.Id
: TvRequest?.RequestedUser?.Id;
var userNotificationIds = await _notifications.GetAll().Where(x => x.UserId == userId).ToListAsync();
notificationIds.AddRange(userNotificationIds);
}
if (model.UserId.HasValue() && (!notificationIds?.Any() ?? true))
{
var user = _userManager.Users.Include(x => x.NotificationUserIds).FirstOrDefault(x => x.Id == model.UserId);
notificationIds = user.NotificationUserIds;
var user = _userManager.Users.FirstOrDefault(x => x.Id == model.UserId);
var userNotificationIds = await _notifications.GetAll().Where(x => x.UserId == model.UserId).ToListAsync();
notificationIds.AddRange(userNotificationIds);
}
if (!notificationIds?.Any() ?? true)
@ -306,21 +310,21 @@ namespace Ombi.Notifications.Agents
$"there are no users to send a notification for {type}, for agent {NotificationAgent.Mobile}");
return null;
}
var playerIds = notificationIds.Select(x => x.PlayerId).ToList();
var playerIds = notificationIds.Select(x => x.Token).ToList();
return playerIds;
}
private async Task<List<string>> GetUsersForIssue(NotificationOptions model, int issueId, NotificationType type)
{
var notificationIds = new List<NotificationUserId>();
var notificationIds = new List<MobileDevices>();
var issue = await _issueRepository.GetAll()
.FirstOrDefaultAsync(x => x.Id == issueId);
// Get the user that raised the issue to send the notification to
var userRaised = await _userManager.Users.Include(x => x.NotificationUserIds).FirstOrDefaultAsync(x => x.Id == issue.UserReportedId);
var userRaised = await _userManager.Users.FirstOrDefaultAsync(x => x.Id == issue.UserReportedId);
notificationIds = userRaised.NotificationUserIds;
notificationIds = await _notifications.GetAll().Where(x => x.UserId == userRaised.Id).ToListAsync();
if (!notificationIds?.Any() ?? true)
{
@ -328,7 +332,7 @@ namespace Ombi.Notifications.Agents
$"there are no users to send a notification for {type}, for agent {NotificationAgent.Mobile}");
return null;
}
var playerIds = notificationIds.Select(x => x.PlayerId).ToList();
var playerIds = notificationIds.Select(x => x.Token).ToList();
return playerIds;
}
@ -338,10 +342,11 @@ namespace Ombi.Notifications.Agents
{
foreach (var user in SubsribedUsers)
{
var notificationId = user.NotificationUserIds;
if (notificationId.Any())
var notificationIds = await _notifications.GetAll().Where(x => x.UserId == user.Id).ToListAsync();
if (notificationIds.Any())
{
playerIds.AddRange(notificationId.Select(x => x.PlayerId));
playerIds.AddRange(notificationIds.Select(x => x.Token));
}
}
}

@ -191,7 +191,7 @@ namespace Ombi.Notifications
protected IQueryable<OmbiUser> GetSubscriptions(int requestId, RequestType type)
{
var subs = RequestSubscription.GetAll().Include(x => x.User).ThenInclude(x => x.NotificationUserIds).Where(x => x.RequestId == requestId && type == x.RequestType);
var subs = RequestSubscription.GetAll().Include(x => x.User).Where(x => x.RequestId == requestId && type == x.RequestType);
return subs.Select(x => x.User);
}

@ -38,7 +38,12 @@ namespace Ombi.Notifications
UserName = req?.RequestedUser?.UserName;
}
Alias = (req?.RequestedUser?.Alias.HasValue() ?? false) ? req?.RequestedUser?.Alias : req?.RequestedUser?.UserName;
if (Alias.IsNullOrEmpty())
{
// Can be set if it's an issue
Alias = (req?.RequestedUser?.Alias.HasValue() ?? false) ? req?.RequestedUser?.Alias : req?.RequestedUser?.UserName;
}
if (pref != null)
{
UserPreference = pref.Value.HasValue() ? pref.Value : Alias;
@ -95,7 +100,10 @@ namespace Ombi.Notifications
AvailableDate = req?.MarkedAsAvailable?.ToString("D") ?? string.Empty;
DenyReason = req?.DeniedReason;
Alias = (req?.RequestedUser?.Alias.HasValue() ?? false) ? req?.RequestedUser?.Alias : req?.RequestedUser?.UserName;
if (Alias.IsNullOrEmpty())
{
Alias = (req?.RequestedUser?.Alias.HasValue() ?? false) ? req?.RequestedUser?.Alias : req?.RequestedUser?.UserName;
}
if (pref != null)
{
UserPreference = pref.Value.HasValue() ? pref.Value : Alias;
@ -143,7 +151,10 @@ namespace Ombi.Notifications
UserName = req?.RequestedUser?.UserName;
}
AvailableDate = req?.MarkedAsAvailable?.ToString("D") ?? string.Empty;
Alias = (req?.RequestedUser?.Alias.HasValue() ?? false) ? req?.RequestedUser?.Alias : req?.RequestedUser?.UserName;
if (Alias.IsNullOrEmpty())
{
Alias = (req?.RequestedUser?.Alias.HasValue() ?? false) ? req?.RequestedUser?.Alias : req?.RequestedUser?.UserName;
}
if (pref != null)
{
UserPreference = pref.Value.HasValue() ? pref.Value : Alias;
@ -223,6 +234,7 @@ namespace Ombi.Notifications
IssueSubject = opts.Substitutes.TryGetValue("IssueSubject", out val) ? val : string.Empty;
NewIssueComment = opts.Substitutes.TryGetValue("NewIssueComment", out val) ? val : string.Empty;
UserName = opts.Substitutes.TryGetValue("IssueUser", out val) ? val : string.Empty;
Alias = opts.Substitutes.TryGetValue("IssueUserAlias", out val) ? val : string.Empty;
Type = opts.Substitutes.TryGetValue("RequestType", out val) ? val.Humanize() : string.Empty;
}

@ -43,6 +43,12 @@ namespace Ombi.Schedule.Jobs.Ombi
if (request.Type == RequestType.Movie)
{
var movieRequest = await _movieRequestRepository.GetAll().FirstOrDefaultAsync(x => x.Id == request.RequestId);
if (movieRequest == null)
{
await _requestQueue.Delete(request);
await _requestQueue.SaveChangesAsync();
continue;
}
var result = await _movieSender.Send(movieRequest);
if (result.Success)
{
@ -53,6 +59,12 @@ namespace Ombi.Schedule.Jobs.Ombi
if (request.Type == RequestType.TvShow)
{
var tvRequest = await _tvRequestRepository.GetChild().FirstOrDefaultAsync(x => x.Id == request.RequestId);
if (tvRequest == null)
{
await _requestQueue.Delete(request);
await _requestQueue.SaveChangesAsync();
continue;
}
var result = await _tvSender.Send(tvRequest);
if (result.Success)
{
@ -63,6 +75,12 @@ namespace Ombi.Schedule.Jobs.Ombi
if (request.Type == RequestType.Album)
{
var musicRequest = await _musicRequestRepository.GetAll().FirstOrDefaultAsync(x => x.Id == request.RequestId);
if (musicRequest == null)
{
await _requestQueue.Delete(request);
await _requestQueue.SaveChangesAsync();
continue;
}
var result = await _musicSender.Send(musicRequest);
if (result.Success)
{

@ -145,6 +145,7 @@ export function JwtTokenGetter() {
MatCheckboxModule,
MatProgressSpinnerModule,
MDBBootstrapModule.forRoot(),
// NbThemeModule.forRoot({ name: 'dark'}),
JwtModule.forRoot({
config: {
tokenGetter: JwtTokenGetter,

@ -74,6 +74,10 @@ export class AuthService extends ServiceHelpers {
return false;
}
public isAdmin() {
return this.hasRole("Admin") || this.hasRole("PowerUser");
}
public logout() {
this.store.remove("id_token");
}

@ -1,12 +1,12 @@
<p-skeleton *ngIf="!fullyLoaded" width="100%" height="315px"></p-skeleton>
<p-skeleton id="cardLoading{{result.id}}" *ngIf="!fullyLoaded" width="100%" height="315px"></p-skeleton>
<div *ngIf="fullyLoaded" class="ombi-card dark-card c" [style.display]="hide ? 'none' : 'block'">
<div id="result{{result.id}}" *ngIf="fullyLoaded" class="ombi-card dark-card c" [style.display]="hide ? 'none' : 'block'">
<div class="card-top-info">
<div class="top-left">
<div class="top-left" id="type{{result.id}}">
{{RequestType[result.type] | humanize}}
</div>
<div class="{{getStatusClass()}} top-right">
<span class="indicator"></span><span class="indicator-text">{{getAvailbilityStatus()}}</span>
<div class="{{getStatusClass()}} top-right" id="status{{result.id}}">
<span class="indicator"></span><span class="indicator-text" id="availabilityStatus{{result.id}}">{{getAvailbilityStatus()}}</span>
</div>
</div>
<img [routerLink]="generateDetailsLink()" id="cardImage" src="{{result.posterPath}}" class="image"
@ -14,14 +14,14 @@
<div class="middle">
<a class="poster-overlay" [routerLink]="generateDetailsLink()">
<div class="summary">
<div class="title">{{result.title}}</div>
<div class="small-text ellipsis">{{result.overview}}</div>
<div class="title" id="title{{result.id}}">{{result.title}}</div>
<div class="small-text ellipsis" id="overview{{result.id}}">{{result.overview}}</div>
</div>
</a>
</div>
<div class="row button-request-container" *ngIf="!result.available && !result.approved">
<div class="row button-request-container" *ngIf="!result.available && !result.approved && !result.requested">
<div class="button-request poster-overlay">
<button mat-raised-button class="btn-green full-width poster-request-btn" (click)="request($event)">
<button id="requestButton{{result.id}}{{result.type}}" mat-raised-button class="btn-green full-width poster-request-btn" (click)="request($event)">
<mat-icon *ngIf="!loading">cloud_download</mat-icon>
<i *ngIf="loading" class="fas fa-spinner fa-pulse fa-2x fa-fw" aria-hidden="true"></i>
</button>

@ -46,7 +46,7 @@ export class DiscoverCardComponent implements OnInit {
public async getExtraTvInfo() {
// if (this.result.tvMovieDb) {
// this.tvSearchResult = await this.searchService.getTvInfoWithMovieDbId(+this.result.id);
this.tvSearchResult = await this.searchService.getTvInfoWithMovieDbId(+this.result.id);
// } else {
// this.tvSearchResult = await this.searchService.getTvInfo(+this.result.id);
// }
@ -173,8 +173,8 @@ export class DiscoverCardComponent implements OnInit {
private updateTvItem(updated: ISearchTvResultV2) {
this.result.title = updated.title;
this.result.id = updated.id;
this.result.available = updated.fullyAvailable || updated.partlyAvailable;
this.result.posterPath = updated.banner;
// this.result.available = updated.fullyAvailable || updated.partlyAvailable;
// this.result.posterPath = updated.banner;
this.result.requested = updated.requested;
this.result.url = updated.imdbId;
this.result.overview = updated.overview;

@ -1,8 +1,8 @@
<div class="right">
<mat-button-toggle-group name="discoverMode" (change)="toggleChanged($event)" value="{{discoverOptions}}" class="discover-filter-buttons-group">
<mat-button-toggle [ngClass]="{'button-active': discoverOptions === DiscoverOption.Combined}" value="{{DiscoverOption.Combined}}" class="discover-filter-button">{{'Discovery.Combined' | translate}}</mat-button-toggle>
<mat-button-toggle [ngClass]="{'button-active': discoverOptions === DiscoverOption.Movie}" value="{{DiscoverOption.Movie}}" class="discover-filter-button">{{'Discovery.Movies' | translate}}</mat-button-toggle>
<mat-button-toggle [ngClass]="{'button-active': discoverOptions === DiscoverOption.Tv}" value="{{DiscoverOption.Tv}}" class="discover-filter-button">{{'Discovery.Tv' | translate}}</mat-button-toggle>
<mat-button-toggle id="{{id}}Combined" [ngClass]="{'button-active': discoverOptions === DiscoverOption.Combined}" value="{{DiscoverOption.Combined}}" class="discover-filter-button">{{'Discovery.Combined' | translate}}</mat-button-toggle>
<mat-button-toggle id="{{id}}Movie" [ngClass]="{'button-active': discoverOptions === DiscoverOption.Movie}" value="{{DiscoverOption.Movie}}" class="discover-filter-button">{{'Discovery.Movies' | translate}}</mat-button-toggle>
<mat-button-toggle id="{{id}}Tv" [ngClass]="{'button-active': discoverOptions === DiscoverOption.Tv}" value="{{DiscoverOption.Tv}}" class="discover-filter-button">{{'Discovery.Tv' | translate}}</mat-button-toggle>
</mat-button-toggle-group>
</div>

@ -20,6 +20,7 @@ export enum DiscoverType {
export class CarouselListComponent implements OnInit {
@Input() public discoverType: DiscoverType;
@Input() public id: string;
@ViewChild('carousel', {static: false}) carousel: Carousel;
public DiscoverOption = DiscoverOption;

@ -4,7 +4,7 @@
<div class="section">
<h2>Popular</h2>
<div>
<carousel-list [discoverType]="DiscoverType.Popular"></carousel-list>
<carousel-list [id]="'popular'" [discoverType]="DiscoverType.Popular"></carousel-list>
</div>
</div>
@ -12,7 +12,7 @@
<div class="section">
<h2>Trending</h2>
<div >
<carousel-list [discoverType]="DiscoverType.Trending"></carousel-list>
<carousel-list [id]="'trending'" [discoverType]="DiscoverType.Trending"></carousel-list>
</div>
</div>
@ -20,7 +20,7 @@
<div class="section">
<h2>Upcoming</h2>
<div>
<carousel-list [discoverType]="DiscoverType.Upcoming"></carousel-list>
<carousel-list [id]="'upcoming'" [discoverType]="DiscoverType.Upcoming"></carousel-list>
</div>
</div>

@ -2,14 +2,14 @@
<div *ngIf="loadingFlag" class="row justify-content-md-center top-spacing loading-spinner">
<mat-spinner [color]="'accent'"></mat-spinner>
</div>
<div *ngIf="discoverResults && discoverResults.length > 0" class="row full-height discoverResults col">
<div class="col-xl-2 col-lg-3 col-md-3 col-6 col-sm-4 small-padding" *ngFor="let result of discoverResults">
<div *ngIf="discoverResults && discoverResults.length > 0" class="row full-height discoverResults col" >
<div id="searchResults" class="col-xl-2 col-lg-3 col-md-3 col-6 col-sm-4 small-padding" *ngFor="let result of discoverResults" data-test="searchResultsCount" attr.search-count="{{discoverResults.length}}">
<discover-card [result]="result"></discover-card>
</div>
</div>
<div *ngIf="!discoverResults || discoverResults.length === 0">
<div class="row justify-content-md-center top-spacing loading-spinner">
<h1> {{'Discovery.NoSearch' | translate}} <i class="far fa-frown" aria-hidden="true"></i></h1>
<div class="row justify-content-md-center top-spacing loading-spinner">
<h1 id="noSearchResult"> {{'Discovery.NoSearch' | translate}} <i class="far fa-frown" aria-hidden="true"></i></h1>
</div>
</div>
</div>

@ -87,7 +87,7 @@ export class DiscoverSearchResultsComponent implements OnInit {
id: m.id,
url: "",
rating: 0,
overview: "",
overview: m.overview,
approved: false,
imdbid: "",
denied: false,

@ -28,6 +28,7 @@ export interface IUsersModel {
}
export interface INavBar {
id: string;
icon: string;
faIcon: string;
name: string;

@ -62,3 +62,10 @@ export interface IUpdateStatus {
issueId: number;
status: IssueStatus;
}
export interface IIssuesSummary {
title: string;
count: number;
providerId: string;
issues: IIssues[];
}

@ -164,6 +164,7 @@ export interface IEpisodesRequests {
available: boolean;
requested: boolean;
approved: boolean;
requestStatus: string;
selected: boolean; // This is for the UI only
}

@ -40,6 +40,7 @@ export interface IMultiSearchResult {
mediaType: string;
title: string;
poster: string;
overview: string;
}
export interface ILanguageRefine {

@ -0,0 +1,27 @@
<mat-card class="issue-card" *ngIf="!deleted">
<mat-card-header>
<mat-card-title>{{issue.subject}}</mat-card-title>
<mat-card-subtitle>{{issue.userReported?.userName}} on {{issue.createdDate | date:short}}</mat-card-subtitle>
</mat-card-header>
<mat-card-content>
<p>
{{issue.description}}
</p>
</mat-card-content>
<mat-card-actions>
<button mat-raised-button (click)="openChat(issue)" color="accent"><i class="far fa-comments"></i> {{'Issues.Chat' | translate }}</button>
<div *ngIf="isAdmin && settings;then content else empty">here is ignored</div>
<ng-template #content>
<button mat-raised-button color="accent"
*ngIf="issue.status === IssueStatus.Pending && settings.enableInProgress"
(click)="inProgress(issue)">{{'Issues.MarkInProgress' | translate }}</button>
<button mat-raised-button color="accent"
*ngIf="issue.status === IssueStatus.Pending && !settings.enableInProgress || issue.status == IssueStatus.InProgress"
(click)="resolve(issue)">{{'Issues.MarkResolved' | translate}}</button>
<button mat-raised-button color="warn" (click)="delete(issue)"><i class="far fa-times-circle"></i> {{'Issues.Delete' | translate}}</button></ng-template>
<ng-template #empty></ng-template>
</mat-card-actions>
</mat-card>

@ -0,0 +1,9 @@
@import "~styles/variables.scss";
::ng-deep .issue-card {
border: 3px solid $ombi-background-primary-accent;
}
.top-spacing {
margin-top:2%;
}

@ -0,0 +1,55 @@
import { Component, Input } from "@angular/core";
import { MatDialog } from '@angular/material/dialog';
import { TranslateService } from "@ngx-translate/core";
import { IIssues, IIssueSettings, IssueStatus } from "../../../interfaces";
import { IssuesService, NotificationService } from "../../../services";
import { IssueChatComponent } from "../issue-chat/issue-chat.component";
@Component({
selector: "issues-details-group",
templateUrl: "details-group.component.html",
styleUrls: ["details-group.component.scss"],
})
export class DetailsGroupComponent {
@Input() public issue: IIssues;
@Input() public isAdmin: boolean;
@Input() public settings: IIssueSettings;
public deleted: boolean;
public IssueStatus = IssueStatus;
public get hasRequest(): boolean {
if (this.issue.requestId) {
return true;
}
return false;
}
constructor(
private translateService: TranslateService, private issuesService: IssuesService,
private notificationService: NotificationService, private dialog: MatDialog) { }
public async delete(issue: IIssues) {
await this.issuesService.deleteIssue(issue.id);
this.notificationService.success(this.translateService.instant("Issues.DeletedIssue"));
this.deleted = true;
}
public openChat(issue: IIssues) {
this.dialog.open(IssueChatComponent, { width: "100vh", data: { issueId: issue.id }, panelClass: 'modal-panel' })
}
public resolve(issue: IIssues) {
this.issuesService.updateStatus({issueId: issue.id, status: IssueStatus.Resolved}).subscribe(() => {
this.notificationService.success(this.translateService.instant("Issues.MarkedAsResolved"));
issue.status = IssueStatus.Resolved;
});
}
public inProgress(issue: IIssues) {
this.issuesService.updateStatus({issueId: issue.id, status: IssueStatus.InProgress}).subscribe(() => {
this.notificationService.success(this.translateService.instant("Issues.MarkedAsInProgress"));
issue.status = IssueStatus.InProgress;
});
}
}

@ -0,0 +1,20 @@
<div class="container top-spacing" *ngIf="details">
<h1>Issues for {{details.title}}</h1>
<div>
<span>{{'Issues.Requested' | translate}}
<i *ngIf="!hasRequest" class="far fa-times-circle"></i>
<i *ngIf="hasRequest" class="far fa-check-circle"></i>
</span>
<div>
<button mat-raised-button color="accent" (click)="navToMedia()"><i class="far fa-eye"></i> {{'Common.ViewDetails' | translate }}</button>
</div>
<div class="row">
<div class="col-6 top-spacing" *ngFor="let issue of details.issues">
<issues-details-group [issue]="issue" [settings]="settings" [isAdmin]="isAdmin"></issues-details-group>
</div>
</div>
</div>
<div class="row">
</div>
</div>

@ -0,0 +1,9 @@
@import "~styles/variables.scss";
::ng-deep .mat-card {
background: $ombi-background-primary-accent;
}
.top-spacing {
margin-top:2%;
}

@ -0,0 +1,93 @@
import { Component, Inject, OnInit, ViewEncapsulation } from "@angular/core";
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { ActivatedRoute, ActivatedRouteSnapshot, Router } from "@angular/router";
import { TranslateService } from "@ngx-translate/core";
import { AuthService } from "../../../auth/auth.service";
import { IIssues, IIssueSettings, IIssuesSummary, IssueStatus, RequestType } from "../../../interfaces";
import { IssuesService, NotificationService, SettingsService } from "../../../services";
import { IssuesV2Service } from "../../../services/issuesv2.service";
import { IssueChatComponent } from "../issue-chat/issue-chat.component";
export interface IssuesDetailsGroupData {
issues: IIssues[];
title: string;
}
@Component({
selector: "issues-details",
templateUrl: "details.component.html",
styleUrls: ["details.component.scss"],
encapsulation: ViewEncapsulation.None
})
export class IssuesDetailsComponent implements OnInit {
public details: IIssuesSummary;
public isAdmin: boolean;
public IssueStatus = IssueStatus;
public settings: IIssueSettings;
public get hasRequest(): boolean {
return this.details.issues.some(x => x.requestId);
}
private providerId: string;
constructor(private authService: AuthService, private settingsService: SettingsService,
private issueServiceV2: IssuesV2Service, private route: ActivatedRoute, private router: Router,
private issuesService: IssuesService, private translateService: TranslateService, private notificationService: NotificationService,
private dialog: MatDialog) {
this.route.params.subscribe(async (params: any) => {
if (typeof params.providerId === 'string' || params.providerId instanceof String) {
this.providerId = params.providerId;
}
});
}
public ngOnInit() {
this.isAdmin = this.authService.hasRole("Admin") || this.authService.hasRole("PowerUser");
this.settingsService.getIssueSettings().subscribe(x => this.settings = x);
this.issueServiceV2.getIssuesByProviderId(this.providerId).subscribe(x => this.details = x);
}
public resolve(issue: IIssues) {
this.issuesService.updateStatus({issueId: issue.id, status: IssueStatus.Resolved}).subscribe(x => {
this.notificationService.success(this.translateService.instant("Issues.MarkedAsResolved"));
issue.status = IssueStatus.Resolved;
});
}
public inProgress(issue: IIssues) {
this.issuesService.updateStatus({issueId: issue.id, status: IssueStatus.InProgress}).subscribe(x => {
this.notificationService.success(this.translateService.instant("Issues.MarkedAsInProgress"));
issue.status = IssueStatus.InProgress;
});
}
public async delete(issue: IIssues) {
await this.issuesService.deleteIssue(issue.id);
this.notificationService.success(this.translateService.instant("Issues.DeletedIssue"));
this.details.issues = this.details.issues.filter((el) => { return el.id !== issue.id; });
}
public openChat(issue: IIssues) {
this.dialog.open(IssueChatComponent, { width: "100vh", data: { issueId: issue.id }, panelClass: 'modal-panel' })
}
public navToMedia() {
const firstIssue = this.details.issues[0];
switch(firstIssue.requestType) {
case RequestType.movie:
this.router.navigate(['/details/movie/', firstIssue.providerId]);
return;
case RequestType.album:
this.router.navigate(['/details/artist/', firstIssue.providerId]);
return;
case RequestType.tvShow:
this.router.navigate(['/details/tv/', firstIssue.providerId]);
return;
}
}
}

@ -1,20 +1,19 @@
import { AuthGuard } from "../../auth/auth.guard";
import { IssuesListComponent } from "./issues-list/issues-list.component";
import { Routes } from "@angular/router";
import { IssuesV2Service } from "../../services/issuesv2.service";
import { IdentityService, SearchService } from "../../services";
import { IssuesDetailsComponent } from "./details/details.component";
import { IssueChatComponent } from "./issue-chat/issue-chat.component";
import { ChatBoxComponent } from "../../shared/chat-box/chat-box.component";
export const components: any[] = [
IssuesListComponent,
];
export const entryComponents: any[] = [
IssuesDetailsComponent,
IssueChatComponent,
ChatBoxComponent,
];
export const providers: any[] = [
];
export const routes: Routes = [
{ path: "", component: IssuesListComponent, canActivate: [AuthGuard] },
IssuesV2Service,
IdentityService,
SearchService,
];

@ -0,0 +1,6 @@
<ombi-chat-box *ngIf="loaded"
[messages]="messages"
(onAddMessage)="addComment($event)"
>
</ombi-chat-box>

@ -0,0 +1,9 @@
@import "~styles/variables.scss";
::ng-deep .mat-card {
background: $ombi-background-primary-accent;
}
.top-spacing {
margin-top:2%;
}

@ -0,0 +1,87 @@
import { Component, Inject, OnInit } from "@angular/core";
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { AuthService } from "../../../auth/auth.service";
import { ILocalUser } from "../../../auth/IUserLogin";
import { IIssuesChat, IIssueSettings, IssueStatus } from "../../../interfaces";
import { IssuesService, SettingsService } from "../../../services";
import { ChatMessages, ChatType } from "../../../shared/chat-box/chat-box.component";
export interface ChatData {
issueId: number;
title: string;
}
@Component({
selector: "issue-chat",
templateUrl: "issue-chat.component.html",
styleUrls: ["issue-chat.component.scss"],
})
export class IssueChatComponent implements OnInit {
public isAdmin: boolean;
public comments: IIssuesChat[] = [];
public IssueStatus = IssueStatus;
public settings: IIssueSettings;
public messages: ChatMessages[] = [];
public loaded: boolean;
private user: ILocalUser;
constructor(public dialogRef: MatDialogRef<IssueChatComponent>,
@Inject(MAT_DIALOG_DATA) public data: ChatData,
private authService: AuthService, private settingsService: SettingsService,
private issueService: IssuesService) { }
public ngOnInit() {
this.isAdmin = this.authService.isAdmin();
this.user = this.authService.claims();
this.settingsService.getIssueSettings().subscribe(x => this.settings = x);
this.issueService.getComments(this.data.issueId).subscribe(x => {
this.comments = x;
this.mapMessages();
this.loaded = true;
});
}
public deleteComment(commentId: number) {
}
public addComment(comment: string) {
this.issueService.addComment({
comment: comment,
issueId: this.data.issueId
}).subscribe(comment => {
this.messages.push({
chatType: ChatType.Sender,
date: comment.date,
id: -1,
message: comment.comment,
username: comment.user.userName
});
});
}
public close() {
this.dialogRef.close();
}
private mapMessages() {
this.comments.forEach((m: IIssuesChat) => {
this.messages.push({
chatType: m.username === this.user.name ? ChatType.Sender : ChatType.Reciever,
date: m.date,
id: m.id,
message: m.comment,
username: m.username
});
});
}
}

@ -1,21 +0,0 @@
<!-- <table mat-table [dataSource]="pendingIssues" multiTemplateDataRows class="mat-elevation-z8">
<ng-container matColumnDef="{{column}}" *ngFor="let column of columnsToDisplay">
<th mat-header-cell *matHeaderCellDef> {{column}} </th>
<td mat-cell *matCellDef="let element"> {{element[column]}} </td>
</ng-container>
<ng-container matColumnDef="expandedDetail">
<td mat-cell *matCellDef="let element" [attr.colspan]="columnsToDisplay.length">
<div class="example-element-detail" [@detailExpand]="element == expandedElement ? 'expanded' : 'collapsed'">
<div class="example-element-diagram">
<div class="example-element-position"> {{element.requestId}} </div>
</div>
</div>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="columnsToDisplay"></tr>
<tr mat-row *matRowDef="let element; columns: columnsToDisplay;" class="example-element-row" [class.example-expanded-row]="expandedElement === element" (click)="expandedElement = expandedElement === element ? null : element">
</tr>
<tr mat-row *matRowDef="let row; columns: ['expandedDetail']" class="example-detail-row"></tr>
</table> -->

@ -1,68 +0,0 @@
import { Component, OnInit } from "@angular/core";
import { IssuesService } from "../../../services";
import { IIssueCount, IIssues, IPagenator, IssueStatus } from "../../../interfaces";
import { COLUMNS } from "./issues-list.constants";
@Component({
selector: "issues-list",
templateUrl: "issues-list.component.html",
})
export class IssuesListComponent implements OnInit {
public columnsToDisplay = COLUMNS
public pendingIssues: IIssues[];
public inProgressIssues: IIssues[];
public resolvedIssues: IIssues[];
public count: IIssueCount;
private takeAmount = 10;
private pendingSkip = 0;
private inProgressSkip = 0;
private resolvedSkip = 0;
constructor(private issueService: IssuesService) { }
public ngOnInit() {
this.getPending();
this.getInProg();
this.getResolved();
this.issueService.getIssuesCount().subscribe(x => this.count = x);
}
public changePagePending(event: IPagenator) {
this.pendingSkip = event.first;
this.getPending();
}
public changePageInProg(event: IPagenator) {
this.inProgressSkip = event.first;
this.getInProg();
}
public changePageResolved(event: IPagenator) {
this.resolvedSkip = event.first;
this.getResolved();
}
private getPending() {
this.issueService.getIssuesPage(this.takeAmount, this.pendingSkip, IssueStatus.Pending).subscribe(x => {
this.pendingIssues = x;
});
}
private getInProg() {
this.issueService.getIssuesPage(this.takeAmount, this.inProgressSkip, IssueStatus.InProgress).subscribe(x => {
this.inProgressIssues = x;
});
}
private getResolved() {
this.issueService.getIssuesPage(this.takeAmount, this.resolvedSkip, IssueStatus.Resolved).subscribe(x => {
this.resolvedIssues = x;
});
}
}

@ -84,7 +84,7 @@
<div class="col-md-12">
<div *ngIf="isAdmin && settings">
<div *ngIf="issue.status === IssueStatus.Pending && settings.enableInProgress">
<button class="btn btn-primary btn-sm bottom-btn" (click)="inProgress()" [translate]="'Issues.MarkInProgress'"></button>
<button class="btn btn-primary btn-sm bottom-btn" (click)="inProgress()">{{'Issues.MarkInProgress' | translate }}</button>
</div>
<div *ngIf="issue.status === IssueStatus.Pending && !settings.enableInProgress || issue.status == IssueStatus.InProgress">
<button class="btn btn-primary btn-sm bottom-btn" (click)="resolve()" [translate]="'Issues.MarkResolved'"></button>

@ -1,25 +1,28 @@
<div class="small-middle-container">
<mat-tab-group>
<mat-tab label="{{'Issues.PendingTitle' | translate}}">
<ng-template matTabContent>
<div *ngIf="pendingIssues">
<issues-table [issues]="pendingIssues" (changePage)="changePagePending($event)" [totalRecords]="count.pending"></issues-table>
</div>
</ng-template>
</mat-tab>
<mat-tab *ngIf="inProgressIssues.length > 0" label="{{'Issues.InProgressTitle' | translate}}">
<ng-template matTabContent>
<div *ngIf="inProgressIssues">
<issues-table [issues]="inProgressIssues" (changePage)="changePageInProg($event)" [totalRecords]="count.inProgress"></issues-table>
</div>
</ng-template>
</mat-tab>
<mat-tab label="{{'Issues.ResolvedTitle' | translate}}">
<ng-template matTabContent>
<div *ngIf="resolvedIssues">
<issues-table [issues]="resolvedIssues" (changePage)="changePageResolved($event)" [totalRecords]="count.resolved"></issues-table>
</div>
</ng-template>
</mat-tab>
</mat-tab-group>
<div *ngIf="count">
<mat-tab-group>
<mat-tab label="{{'Issues.PendingTitle' | translate}}">
<ng-template matTabContent>
<div *ngIf="pendingIssues.length > 0">
<issues-table [issues]="pendingIssues" (changePage)="changePagePending($event)" [totalRecords]="count.pending"></issues-table>
</div>
</ng-template>
</mat-tab>
<mat-tab *ngIf="inProgressIssues.length > 0" label="{{'Issues.InProgressTitle' | translate}}">
<ng-template matTabContent>
<div *ngIf="inProgressIssues">
<issues-table [issues]="inProgressIssues" (changePage)="changePageInProg($event)" [totalRecords]="count.inProgress"></issues-table>
</div>
</ng-template>
</mat-tab>
<mat-tab label="{{'Issues.ResolvedTitle' | translate}}">
<ng-template matTabContent>
<div *ngIf="resolvedIssues.length > 0">
<issues-table [issues]="resolvedIssues" (changePage)="changePageResolved($event)" [totalRecords]="count.resolved"></issues-table>
</div>
</ng-template>
</mat-tab>
</mat-tab-group>
</div>
</div>

@ -2,9 +2,10 @@ import { Component, OnInit } from "@angular/core";
import { IssuesService } from "../services";
import { IIssueCount, IIssues, IPagenator, IssueStatus } from "../interfaces";
import { IIssueCount, IIssues, IIssuesSummary, IPagenator, IssueStatus } from "../interfaces";
import { PageEvent } from '@angular/material/paginator';
import { IssuesV2Service } from "../services/issuesv2.service";
@Component({
templateUrl: "issues.component.html",
@ -12,9 +13,9 @@ import { PageEvent } from '@angular/material/paginator';
})
export class IssuesComponent implements OnInit {
public pendingIssues: IIssues[];
public inProgressIssues: IIssues[];
public resolvedIssues: IIssues[];
public pendingIssues: IIssuesSummary[];
public inProgressIssues: IIssuesSummary[];
public resolvedIssues: IIssuesSummary[];
public count: IIssueCount;
@ -23,7 +24,7 @@ export class IssuesComponent implements OnInit {
private inProgressSkip = 0;
private resolvedSkip = 0;
constructor(private issueService: IssuesService) { }
constructor(private issuev2Service: IssuesV2Service, private issueService: IssuesService) { }
public ngOnInit() {
this.getPending();
@ -48,19 +49,19 @@ export class IssuesComponent implements OnInit {
}
private getPending() {
this.issueService.getIssuesPage(this.takeAmount, this.pendingSkip, IssueStatus.Pending).subscribe(x => {
this.issuev2Service.getIssues(this.pendingSkip, this.takeAmount, IssueStatus.Pending).subscribe(x => {
this.pendingIssues = x;
});
}
private getInProg() {
this.issueService.getIssuesPage(this.takeAmount, this.inProgressSkip, IssueStatus.InProgress).subscribe(x => {
this.issuev2Service.getIssues(this.inProgressSkip, this.takeAmount, IssueStatus.InProgress).subscribe(x => {
this.inProgressIssues = x;
});
}
private getResolved() {
this.issueService.getIssuesPage(this.takeAmount, this.resolvedSkip, IssueStatus.Resolved).subscribe(x => {
this.issuev2Service.getIssues(this.resolvedSkip, this.takeAmount, IssueStatus.Resolved).subscribe(x => {
this.resolvedIssues = x;
});
}

@ -1,17 +1,17 @@
import { NgModule } from "@angular/core";
import { RouterModule, Routes } from "@angular/router";
// import { NbChatModule, NbThemeModule } from '@nebular/theme';
import { OrderModule } from "ngx-order-pipe";
import { IdentityService, SearchService } from "../services";
import { AuthGuard } from "../auth/auth.guard";
import { SharedModule as OmbiShared } from "../shared/shared.module";
import { SharedModule } from "../shared/shared.module";
import { IssueDetailsComponent } from "./issueDetails.component";
import { IssuesComponent } from "./issues.component";
import { IssuesTableComponent } from "./issuestable.component";
import { IssuesDetailsComponent } from "./components/details/details.component";
import { PipeModule } from "../pipes/pipe.module";
@ -19,7 +19,7 @@ import * as fromComponents from "./components";
const routes: Routes = [
{ path: "", component: IssuesComponent, canActivate: [AuthGuard] },
{ path: ":id", component: IssueDetailsComponent, canActivate: [AuthGuard] },
{ path: ":providerId", component: IssuesDetailsComponent, canActivate: [AuthGuard] },
];
@NgModule({
@ -27,7 +27,8 @@ const routes: Routes = [
RouterModule.forChild(routes),
OrderModule,
PipeModule,
OmbiShared,
SharedModule,
// NbChatModule,
],
declarations: [
IssuesComponent,
@ -39,8 +40,7 @@ const routes: Routes = [
RouterModule,
],
providers: [
IdentityService,
SearchService,
...fromComponents.providers
],
})

@ -6,32 +6,15 @@
<td mat-cell *matCellDef="let element"> {{element.title}} </td>
</ng-container>
<ng-container matColumnDef="category">
<th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> {{ 'Issues.Category' | translate}} </th>
<td mat-cell *matCellDef="let element"> {{element.issueCategory.value}} </td>
</ng-container>
<ng-container matColumnDef="subject">
<th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> {{ 'Issues.Subject' | translate}} </th>
<td mat-cell *matCellDef="let element"> {{element.subject}} </td>
</ng-container>
<ng-container matColumnDef="status">
<th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> {{ 'Issues.Status' | translate}} </th>
<td mat-cell *matCellDef="let element"> {{IssueStatus[element.status] | humanize}} </td>
</ng-container>
<ng-container matColumnDef="reportedBy">
<th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> {{ 'Issues.ReportedBy' | translate}} </th>
<td mat-cell *matCellDef="let element"> {{element.userReported.userAlias}} </td>
<ng-container matColumnDef="count">
<th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> {{ 'Issues.Count' | translate}} </th>
<td mat-cell *matCellDef="let element"> {{element.count}} </td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef> </th>
<td mat-cell *matCellDef="let element">
<button *ngIf="element.requestType === 1" mat-raised-button color="accent" [routerLink]="'/details/movie/' + element.providerId">{{ 'Issues.Details' | translate}}</button>
<button *ngIf="element.requestType === 0" mat-raised-button color="accent" [routerLink]="'/details/tv/' + element.providerId">{{ 'Issues.Details' | translate}}</button>
<button *ngIf="element.requestType === 2" mat-raised-button color="accent" [routerLink]="'/details/artist/request/' + element.providerId">{{ 'Issues.Details' | translate}}</button>
<button mat-raised-button color="accent" [routerLink]="[element.providerId]">{{ 'Issues.Details' | translate}}</button>
</td>
</ng-container>

@ -1,6 +1,7 @@
import { Component, EventEmitter, Input, Output } from "@angular/core";
import { MatDialog } from "@angular/material/dialog";
import { IIssues, IPagenator, IssueStatus } from "../interfaces";
import { IIssuesSummary, IPagenator, IssueStatus } from "../interfaces";
@Component({
selector: "issues-table",
@ -8,12 +9,14 @@ import { IIssues, IPagenator, IssueStatus } from "../interfaces";
})
export class IssuesTableComponent {
@Input() public issues: IIssues[];
constructor(public dialog: MatDialog) { }
@Input() public issues: IIssuesSummary[];
@Input() public totalRecords: number;
@Output() public changePage = new EventEmitter<IPagenator>();
public displayedColumns = ["title", "category", "subject", "status", "reportedBy", "actions"]
public displayedColumns = ["title", "count", "actions"]
public IssueStatus = IssueStatus;
public resultsLength: number;
public gridCount: string = "15";
@ -48,5 +51,4 @@ export class IssuesTableComponent {
public paginate(event: IPagenator) {
this.changePage.emit(event);
}
}

@ -42,7 +42,7 @@
</div>
</div>
<div class="col-md-3 offset-md-6 vcenter">
<button id="continue" mat-raised-button [routerLink]="['/login', 'true']" color="accent" type="submit">{{ 'Common.ContinueButton' | translate }}</button>
<button id="continue" mat-raised-button [routerLink]="['/login', 'true']" color="accent" type="submit" data-cy="continue">{{ 'Common.ContinueButton' | translate }}</button>
</div>
</div>
</div>

@ -7,7 +7,7 @@
<mat-card class="mat-elevation-z8 top-margin login-card">
<H1 *ngIf="!customizationSettings.logo && !customizationSettings.applicationName" class="login_logo">OMBI</H1>
<H1 *ngIf="customizationSettings.applicationName && !customizationSettings.logo" class="login_logo custom">{{customizationSettings.applicationName}}</H1>
<H1 *ngIf="customizationSettings.applicationName && !customizationSettings.logo" [ngClass]="{'bigText': customizationSettings.applicationName.length >= 7 && customizationSettings.applicationName.length < 14, 'hugeText': customizationSettings.applicationName.length >= 14 }" class="login_logo custom">{{customizationSettings.applicationName}}</H1>
<img mat-card-image *ngIf="customizationSettings.logo" [src]="customizationSettings.logo">
<mat-card-content id="login-box" *ngIf="!authenticationSettings.enableOAuth || loginWithOmbi">
<form *ngIf="authenticationSettings" class="form-signin" novalidate [formGroup]="form" (ngSubmit)="onSubmit(form)">
@ -27,7 +27,7 @@
<mat-checkbox formControlName="rememberMe">{{'Login.RememberMe' | translate}}</mat-checkbox>
<button id="sign-in" mat-raised-button color="accent" type="submit">{{'Login.SignInButton' | translate}}</button>
<button id="sign-in" mat-raised-button color="accent" data-cy="OmbiButton" type="submit">{{'Login.SignInButton' | translate}}</button>
<a [routerLink]="['/reset']" class="forgot-password col-md-12">
<b [translate]="'Login.ForgottenPassword'"></b>
@ -38,8 +38,8 @@
<mat-card-content *ngIf="authenticationSettings.enableOAuth && !loginWithOmbi" class="login-buttons">
<div>
<button id="sign-in" mat-raised-button color="primary" type="submit" (click)="loginWithOmbi = true">{{'Login.SignInWith' | translate:appNameTranslate}}</button>
<button id="sign-plex" mat-raised-button color="accent" type="button" (click)="oauth()">
<button id="sign-in" mat-raised-button color="primary" type="submit" data-cy="OmbiButton" (click)="loginWithOmbi = true">{{'Login.SignInWith' | translate:appNameTranslate}}</button>
<button id="sign-plex" mat-raised-button color="accent" type="button" data-cy="oAuthPlexButton" (click)="oauth()">
<span *ngIf="!oauthLoading">{{'Login.SignInWithPlex' | translate}}</span>
<span *ngIf="oauthLoading"><i class="fas fa-circle-notch fa-spin fa-fw"></i></span>
</button>

@ -203,15 +203,19 @@ div.bg {
justify-content: center;
font-weight: 700;
font-size: 10em;
&.custom {
font-size: 5em;
}
&.hugeText {
font-size: 3vw;
}
width:100%;
margin-bottom:70px;
}
@media (max-width: 600px){
@media (max-width: 700px){
.login-card H1.login_logo{
font-size:20vw;
&.hugeText {
font-size: 7vw;
}
}
}

@ -73,7 +73,7 @@ export class LoginComponent implements OnDestroy, OnInit {
});
this.form = this.fb.group({
username: [""],
username: ["", Validators.required],
password: [""],
rememberMe: [false],
});
@ -112,7 +112,7 @@ export class LoginComponent implements OnDestroy, OnInit {
public onSubmit(form: FormGroup) {
if (form.invalid) {
this.notify.open(this.errorValidation, "OK", {
duration: 3000
duration: 300000
});
return;
}
@ -139,7 +139,7 @@ export class LoginComponent implements OnDestroy, OnInit {
}, err => {
this.notify.open(this.errorBody, "OK", {
duration: 3000
duration: 3000000
})
});
});

@ -20,6 +20,7 @@ import { IssuesPanelComponent } from "./shared/issues-panel/issues-panel.compone
import { TvAdvancedOptionsComponent } from "./tv/panels/tv-advanced-options/tv-advanced-options.component";
import { RequestBehalfComponent } from "./shared/request-behalf/request-behalf.component";
import { TvRequestGridComponent } from "./tv/panels/tv-request-grid/tv-request-grid.component";
import { DetailsGroupComponent } from "../../issues/components/details-group/details-group.component";
export const components: any[] = [
MovieDetailsComponent,

@ -115,9 +115,13 @@ export class MovieDetailsComponent {
}
public async issue() {
let provider = this.movie.id.toString();
if (this.movie.imdbId) {
provider = this.movie.imdbId;
}
const dialogRef = this.dialog.open(NewIssueComponent, {
width: '500px',
data: { requestId: this.movieRequest ? this.movieRequest.id : null, requestType: RequestType.movie, providerId: this.movie.imdbId ? this.movie.imdbId : this.movie.id, title: this.movie.title }
data: { requestId: this.movieRequest ? this.movieRequest.id : null, requestType: RequestType.movie, providerId: provider, title: this.movie.title }
});
}

@ -13,6 +13,11 @@
<!-- content start -->
<mat-accordion class="mat-elevation-z8">
<div *ngFor="let issue of issues">
<issues-details-group [issue]="issue" [settings]="settings" [isAdmin]="isAdmin"></issues-details-group>
</div>
<!--
<mat-expansion-panel *ngFor="let issue of issues">
<mat-expansion-panel-header>
<mat-panel-title>
@ -54,7 +59,7 @@
<button mat-raised-button color="warn" (click)="delete(issue)"> {{ 'Issues.Delete' | translate }}</button>
</div>
</div>
</mat-expansion-panel>
</mat-expansion-panel> -->
</mat-accordion>
<!-- content end -->

@ -6,10 +6,11 @@ import { TranslateService } from "@ngx-translate/core";
@Component({
selector: "issues-panel",
templateUrl: "./issues-panel.component.html",
styleUrls: ["./issues-panel.component.scss"]
styleUrls: ["./issues-panel.component.scss"],
})
export class IssuesPanelComponent implements OnInit {
@Input() public providerId: string;
@Input() public isAdmin: boolean;
@ -22,7 +23,6 @@ export class IssuesPanelComponent implements OnInit {
constructor(private issuesService: IssuesService, private notificationService: NotificationService,
private translateService: TranslateService, private settingsService: SettingsService) {
}
public async ngOnInit() {
@ -54,7 +54,7 @@ export class IssuesPanelComponent implements OnInit {
this.issuesCount = this.issues.length;
this.calculateOutstanding();
}
private calculateOutstanding() {
this.isOutstanding = this.issues.some((i) => {
return i.status !== IssueStatus.Resolved;

@ -10,7 +10,7 @@ import { TranslateService } from "@ngx-translate/core";
templateUrl: "./new-issue.component.html",
})
export class NewIssueComponent implements OnInit {
public issue: IIssues;
public issueCategories: IIssueCategory[];
@ -40,9 +40,9 @@ export class NewIssueComponent implements OnInit {
public async ngOnInit(): Promise<void> {
this.issueCategories = await this.issueService.getCategories().toPromise();
}
}
public async createIssue() {
public async createIssue() {
const result = await this.issueService.createIssue(this.issue).toPromise();
if(result) {
this.messageService.send(this.translate.instant("Issues.IssueDialog.IssueCreated"));

@ -8,21 +8,21 @@
<img class="rating-small" src="{{baseUrl}}/images/{{ratings.class === 'rotten' ? 'rotten-rotten.svg' : 'rotten-fresh.svg'}}"> {{ratings.score}}%
</span>
</div>
<div *ngIf="streams?.length > 0" class="streaming-on-container">
<div *ngIf="streams?.length > 0" id="streamingContainer" class="streaming-on-container">
<hr>
<div class="streaming-on-content">
<span class="label">{{'MediaDetails.StreamingOn' | translate }}:</span>
<div>
<span *ngFor="let stream of streams">
<img class="stream-small" [matTooltip]="stream.streamingProvider" src="https://image.tmdb.org/t/p/original{{stream.logo}}">
<span *ngFor="let stream of sortBy('order')">
<img class="stream-small" id="stream{{stream.streamingProvider}}" [matTooltip]="stream.streamingProvider" src="https://image.tmdb.org/t/p/original{{stream.logo}}">
</span>
</div>
</div>
</div>
<hr>
<div *ngIf="tv.status">
<span class="label">{{'MediaDetails.Status' | translate }}:</span>
{{tv.status}}
<span class="label">{{'MediaDetails.Status' | translate }}:</span>
<span id="status"> {{tv.status}}</span>
</div>
<span class="label">First Aired:</span>
{{tv.firstAired | date: 'mediumDate'}}

@ -35,4 +35,8 @@ export class TvInformationPanelComponent implements OnInit {
});
this.seasonCount = this.tv.seasonRequests.length;
}
public sortBy(prop: string) {
return this.streams.sort((a, b) => a[prop] > b[prop] ? 1 : a[prop] === b[prop] ? 0 : -1);
}
}

@ -3,7 +3,7 @@
<mat-tab *ngFor="let season of tv.seasonRequests">
<ng-template mat-tab-label>
<div class="{{getStatusClass(season)}} top-right">
<div attr.data-test="classStatus{{season.seasonNumber}}" class="{{getStatusClass(season)}} top-right">
<span>{{ 'Requests.Season' | translate }} {{season.seasonNumber}}</span>
</div>
</ng-template>
@ -19,13 +19,13 @@
<ng-container matColumnDef="select">
<th mat-header-cell *matHeaderCellDef>
<mat-checkbox *ngIf="isSeasonCheckable(season)" (change)="$event ? masterToggle(season.episodes) : null"
<mat-checkbox attr.data-test="masterCheckbox{{season.seasonNumber}}" *ngIf="isSeasonCheckable(season)" (change)="$event ? masterToggle(season.episodes) : null"
[checked]="selection.hasValue() && isAllSelected(season.episodes)"
[indeterminate]="selection.hasValue() && !isAllSelected(season.episodes)">
</mat-checkbox>
</th>
<td mat-cell *matCellDef="let row">
<mat-checkbox *ngIf="!row.available && !row.requested && !row.approved" (click)="$event.stopPropagation()"
<mat-checkbox attr.data-test="episodeCheckbox{{season.seasonNumber}}{{row.episodeNumber}}" *ngIf="!row.available && !row.requested && !row.approved" (click)="$event.stopPropagation()"
(change)="$event ? selection.toggle(row) : null"
[checked]="selection.isSelected(row)">
</mat-checkbox>
@ -50,7 +50,7 @@
<ng-container matColumnDef="status">
<th mat-header-cell *matHeaderCellDef> {{ 'Requests.GridStatus' | translate }} </th>
<td mat-cell *matCellDef="let ep">
<div class="{{getEpisodeStatusClass(ep)}} top-right">
<div attr.data-test="episodeStatus{{season.seasonNumber}}{{ep.episodeNumber}}" class="{{getEpisodeStatusClass(ep)}} top-right">
<span>{{ep.requestStatus | translate}}</span>
</div>
</td>
@ -74,15 +74,15 @@
-->
<button *ngIf="!tv.fullyAvailable && requestable" mat-fab color="accent" class="floating-fab" [matMenuTriggerFor]="aboveMenu">
<button *ngIf="!tv.fullyAvailable && requestable" mat-fab color="accent" id="addFabBtn" class="floating-fab" [matMenuTriggerFor]="aboveMenu">
<mat-icon>add</mat-icon></button>
<mat-menu #aboveMenu="matMenu" yPosition="above">
<button mat-menu-item (click)="requestAllSeasons()">{{'Search.TvShows.AllSeasons' | translate }}</button>
<button id="requestAll" mat-menu-item (click)="requestAllSeasons()">{{'Search.TvShows.AllSeasons' | translate }}</button>
<button mat-menu-item (click)="requestFirstSeason()">{{ 'Search.TvShows.FirstSeason' | translate }}</button>
<button id="requestFirst" mat-menu-item (click)="requestFirstSeason()">{{ 'Search.TvShows.FirstSeason' | translate }}</button>
<button mat-menu-item (click)="requestLatestSeason()">{{ 'Search.TvShows.LatestSeason' | translate }}</button>
<button id="requestLatest" mat-menu-item (click)="requestLatestSeason()">{{ 'Search.TvShows.LatestSeason' | translate }}</button>
<button mat-menu-item (click)="submitRequests()">{{ 'Common.Request' | translate }}</button>
<button id="requestSelected" mat-menu-item (click)="submitRequests()">{{ 'Common.Request' | translate }}</button>
</mat-menu>

@ -51,6 +51,7 @@ export class TvRequestGridComponent {
season.episodes.forEach(ep => {
if (this.selection.isSelected(ep)) {
ep.requested = true;
ep.requestStatus = "Common.PendingApproval";
seasonsViewModel.episodes.push({ episodeNumber: ep.episodeNumber });
}
});
@ -66,6 +67,27 @@ export class TvRequestGridComponent {
this.selection.clear();
if (this.tv.firstSeason) {
this.tv.seasonRequests[0].episodes.forEach(ep => {
ep.requested = true;
ep.requestStatus = "Common.PendingApproval";
});
}
if (this.tv.requestAll) {
this.tv.seasonRequests.forEach(season => {
season.episodes.forEach(ep => {
ep.requested = true;
ep.requestStatus = "Common.PendingApproval";
});
});
}
if (this.requestLatestSeason) {
this.tv.seasonRequests[this.tv.seasonRequests.length - 1].episodes.forEach(ep => {
ep.requested = true;
ep.requestStatus = "Common.PendingApproval";
});
}
} else {
this.notificationService.send(requestResult.errorMessage ? requestResult.errorMessage : requestResult.message);
}

@ -69,6 +69,7 @@
<button *ngIf="!request.available" mat-raised-button color="warn" (click)="changeAvailability(request, true);">{{ 'Requests.MarkAvailable' | translate }}</button>
<button *ngIf="request.available" mat-raised-button color="warn" (click)="changeAvailability(request, false);">{{ 'Requests.MarkUnavailable' | translate }}</button>
<button *ngIf="!request.denied" mat-raised-button color="danger" (click)="deny(request);">{{ 'Requests.Deny' | translate }}</button>
<button mat-raised-button color="danger" (click)="delete(request);">{{ 'Requests.RequestPanel.Delete' | translate }}</button>
</div>

@ -40,6 +40,15 @@ export class TvRequestsPanelComponent {
}
}
public async delete(request: IChildRequests) {
const result = await this.requestService.deleteChild(request.id).toPromise();
if (result) {
this.tvRequest.splice(this.tvRequest.indexOf(request),1);
this.messageService.send("Request has been Deleted", "Ok");
}
}
public changeAvailability(request: IChildRequests, available: boolean) {
request.available = available;
request.seasonRequests.forEach((season) => {

@ -49,18 +49,24 @@
<!--Next to poster-->
<div class="details-button-container">
<div class="col-12 media-row">
<button *ngIf="!tv.fullyAvailable" mat-raised-button class="btn-spacing" color="primary"
<button *ngIf="!tv.fullyAvailable" mat-raised-button id="requestBtn" class="btn-spacing" color="primary"
(click)="request()"><i class="fas fa-plus"></i>
{{ 'Common.Request' | translate }}</button>
<button *ngIf="tv.fullyAvailable" mat-raised-button class="btn-spacing" color="accent"
<button *ngIf="tv.fullyAvailable && !tv.partlyAvailable" id="availableBtn" mat-raised-button class="btn-spacing" color="accent"
[disabled]>
<i class="fas fa-check"></i> {{'Common.Available' | translate }}</button>
<button *ngIf="tv.partlyAvailable && !tv.fullyAvailable" mat-raised-button
<button *ngIf="tv.partlyAvailable && !tv.fullyAvailable" id="partiallyAvailableBtn" mat-raised-button
class="btn-spacing" color="accent" [disabled]>
<i class="fas fa-check"></i> {{'Common.PartiallyAvailable' | translate }}</button>
<button mat-raised-button class="btn-spacing" color="danger" *ngIf="issuesEnabled" (click)="issue()">
<!-- There are unaired episodes-->
<button *ngIf="tv.partlyAvailable && tv.fullyAvailable" id="partiallyAvailableBtn" mat-raised-button
class="btn-spacing" color="accent" [disabled]>
<i class="fas fa-check"></i> {{'Common.PartiallyAvailable' | translate }}</button>
<!-- end unaired episodes-->
<button mat-raised-button class="btn-spacing" color="danger" id="reportIssueBtn" *ngIf="issuesEnabled" (click)="issue()">
<i class="fas fa-exclamation"></i> {{
'Requests.ReportIssue' | translate }}</button>
@ -102,7 +108,7 @@
</div>
<div class="col-12 col-md-10">
<tv-request-grid [tvRequest]="tvRequest" [isAdmin]="isAdmin" [tv]="tv"></tv-request-grid>
<tv-request-grid id="requests-grid" [tvRequest]="tvRequest" [isAdmin]="isAdmin" [tv]="tv"></tv-request-grid>
</div>
<div class="col-12 col-md-2">
@ -114,11 +120,11 @@
<div class="issuesPanel">
<issues-panel [providerId]="tv.theTvDbId" [isAdmin]="isAdmin"></issues-panel>
</div>
<mat-accordion>
<mat-accordion id="requests-panel">
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
Requests
{{'Requests.Title' | translate}}
</mat-panel-title>
</mat-expansion-panel-header>
<tv-requests-panel [tvRequest]="tvRequest" [isAdmin]="isAdmin"></tv-requests-panel>

@ -3,16 +3,16 @@
[attr.role]="(isHandset$ | async) ? 'dialog' : 'navigation'" [mode]="(isHandset$ | async) ? 'over' : 'side'"
[opened]="!(isHandset$ | async)">
<mat-toolbar class="application-name">{{applicationName}}</mat-toolbar>
<mat-toolbar class="application-name" id="nav-applicationName">{{applicationName}}</mat-toolbar>
<div class="outer-profile">
<div class="profile-img-container">
<div class="profile-img">
<img
<img id="profile-image"
src="https://www.gravatar.com/avatar/{{emailHash}}?d={{applicationLogo ? applicationLogo : 'https://raw.githubusercontent.com/Ombi-app/Ombi/gh-pages/img/android-chrome-512x512.png'}}" />
</div>
<div class="profile-info">
<h3>{{username}}</h3>
<h3 id="profile-username">{{username}}</h3>
<p>{{welcomeText | translate}}</p>
</div>
</div>
@ -23,7 +23,7 @@
<div *ngIf="(nav.requiresAdmin && isAdmin || !nav.requiresAdmin) && nav.enabled">
<a *ngIf="nav.externalLink" mat-list-item [href]="nav.link" target="_blank"
<a id="{{nav.id}}" *ngIf="nav.externalLink" mat-list-item [href]="nav.link" target="_blank"
matTooltip="{{nav.toolTipMessage | translate}}" matTooltipPosition="right"
[routerLinkActive]="'active-list-item'">
@ -33,7 +33,7 @@
style="padding-left: 5px; padding-right: 5px;" aria-hidden="true"></i>
&nbsp;{{nav.name | translate}}
</a>
<a *ngIf="!nav.externalLink" mat-list-item [routerLink]="nav.link" [style]="nav.color"
<a id="{{nav.id}}" *ngIf="!nav.externalLink" mat-list-item [routerLink]="nav.link" [style]="nav.color"
[routerLinkActive]="'active-list-item'">
<mat-icon aria-label="Side nav toggle icon">{{nav.icon}}</mat-icon>
@ -76,22 +76,22 @@
</span>
</div>
<div class="col-2 top-filter">
<button mat-icon-button [matMenuTriggerFor]="filterMenu">
<button id="search-filter" mat-icon-button [matMenuTriggerFor]="filterMenu">
<mat-icon>filter_alt</mat-icon>
</button>
<mat-menu #filterMenu="matMenu" yPosition="below" class="smaller-panel">
<mat-slide-toggle class="mat-menu-item slide-menu" [checked]="searchFilter.movies"
<mat-slide-toggle id="filterMovies" class="mat-menu-item slide-menu" [checked]="searchFilter.movies"
(click)="$event.stopPropagation()" (change)="changeFilter($event,SearchFilterType.Movie)">
{{ 'NavigationBar.Filter.Movies' | translate}}</mat-slide-toggle>
<mat-slide-toggle class="mat-menu-item slide-menu" [checked]="searchFilter.tvShows"
<mat-slide-toggle id="filterTv" class="mat-menu-item slide-menu" [checked]="searchFilter.tvShows"
(click)="$event.stopPropagation()" (change)="changeFilter($event,SearchFilterType.TvShow)">
{{ 'NavigationBar.Filter.TvShows' | translate}}</mat-slide-toggle>
<mat-slide-toggle class="mat-menu-item slide-menu" [checked]="searchFilter.music"
<mat-slide-toggle id="filterMusic" class="mat-menu-item slide-menu" [checked]="searchFilter.music"
(click)="$event.stopPropagation()" (change)="changeFilter($event,SearchFilterType.Music)">
{{ 'NavigationBar.Filter.Music' | translate}}</mat-slide-toggle>
<mat-slide-toggle class="mat-menu-item slide-menu" [checked]="searchFilter.people"
<!-- <mat-slide-toggle class="mat-menu-item slide-menu" [checked]="searchFilter.people"
(click)="$event.stopPropagation()" (change)="changeFilter($event,SearchFilterType.People)">
{{ 'NavigationBar.Filter.People' | translate}}</mat-slide-toggle>
{{ 'NavigationBar.Filter.People' | translate}}</mat-slide-toggle> -->
</mat-menu>
</div>

@ -83,16 +83,16 @@ export class MyNavComponent implements OnInit {
this.filterService.changeFilter(this.searchFilter);
}
this.navItems = [
{ name: "NavigationBar.Discover", icon: "find_replace", link: "/discover", requiresAdmin: false, enabled: true, faIcon: null },
{ name: "NavigationBar.Requests", icon: "list", link: "/requests-list", requiresAdmin: false, enabled: true, faIcon: null },
{ name: "NavigationBar.Issues", icon: "notification_important", link: "/issues", requiresAdmin: false, enabled: this.issuesEnabled, faIcon: null },
{ name: "NavigationBar.UserManagement", icon: "account_circle", link: "/usermanagement", requiresAdmin: true, enabled: true, faIcon: null },
// { name: "NavigationBar.Calendar", icon: "calendar_today", link: "/calendar", requiresAdmin: false, enabled: true },
{ name: "NavigationBar.Donate", icon: "attach_money", link: "https://www.paypal.me/PlexRequestsNet", externalLink: true, requiresAdmin: true, enabled: true, toolTip: true, style: "color:red;", toolTipMessage: 'NavigationBar.DonateTooltip', faIcon: null },
{ name: "NavigationBar.Donate", icon: "attach_money", link: customizationSettings.customDonationUrl, externalLink: true, requiresAdmin: false, enabled: customizationSettings.enableCustomDonations, toolTip: true, toolTipMessage: customizationSettings.customDonationMessage, faIcon: null },
{ name: "NavigationBar.FeatureSuggestion", icon: null, link: "https://features.ombi.io/", externalLink: true, requiresAdmin: true, enabled: true, toolTip: true, toolTipMessage: 'NavigationBar.FeatureSuggestionTooltip', faIcon: "fa-lightbulb" },
{ name: "NavigationBar.Settings", icon: "settings", link: "/Settings/About", requiresAdmin: true, enabled: true, faIcon: null },
{ name: "NavigationBar.UserPreferences", icon: "person", link: "/user-preferences", requiresAdmin: false, enabled: true, faIcon: null },
{ id: "nav-discover", name: "NavigationBar.Discover", icon: "find_replace", link: "/discover", requiresAdmin: false, enabled: true, faIcon: null },
{ id: "nav-requests", name: "NavigationBar.Requests", icon: "list", link: "/requests-list", requiresAdmin: false, enabled: true, faIcon: null },
{ id: "nav-issues", name: "NavigationBar.Issues", icon: "notification_important", link: "/issues", requiresAdmin: false, enabled: this.issuesEnabled, faIcon: null },
{ id: "nav-userManagement", name: "NavigationBar.UserManagement", icon: "account_circle", link: "/usermanagement", requiresAdmin: true, enabled: true, faIcon: null },
//id: "", { name: "NavigationBar.Calendar", icon: "calendar_today", link: "/calendar", requiresAdmin: false, enabled: true },
{ id: "nav-adminDonate", name: "NavigationBar.Donate", icon: "attach_money", link: "https://www.paypal.me/PlexRequestsNet", externalLink: true, requiresAdmin: true, enabled: true, toolTip: true, style: "color:red;", toolTipMessage: 'NavigationBar.DonateTooltip', faIcon: null },
{ id: "nav-userDonate", name: "NavigationBar.Donate", icon: "attach_money", link: customizationSettings.customDonationUrl, externalLink: true, requiresAdmin: false, enabled: customizationSettings.enableCustomDonations, toolTip: true, toolTipMessage: customizationSettings.customDonationMessage, faIcon: null },
{ id: "nav-featureSuggestion", name: "NavigationBar.FeatureSuggestion", icon: null, link: "https://features.ombi.io/", externalLink: true, requiresAdmin: true, enabled: true, toolTip: true, toolTipMessage: 'NavigationBar.FeatureSuggestionTooltip', faIcon: "fa-lightbulb" },
{ id: "nav-settings", name: "NavigationBar.Settings", icon: "settings", link: "/Settings/About", requiresAdmin: true, enabled: true, faIcon: null },
{ id: "nav-userPreferences", name: "NavigationBar.UserPreferences", icon: "person", link: "/user-preferences", requiresAdmin: false, enabled: true, faIcon: null },
];
}

@ -0,0 +1,23 @@
import { PlatformLocation, APP_BASE_HREF } from "@angular/common";
import { Injectable, Inject } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { Observable } from "rxjs";
import { IIssueCategory, IIssueComments, IIssueCount, IIssues, IIssuesChat, IIssuesSummary, INewIssueComments, IssueStatus, IUpdateStatus } from "../interfaces";
import { ServiceHelpers } from "./service.helpers";
@Injectable()
export class IssuesV2Service extends ServiceHelpers {
constructor(http: HttpClient, @Inject(APP_BASE_HREF) href:string) {
super(http, "/api/v2/Issues/", href);
}
public getIssues(position: number, take: number, status: IssueStatus): Observable<IIssuesSummary[]> {
return this.http.get<IIssuesSummary[]>(`${this.url}${position}/${take}/${status}`, {headers: this.headers});
}
public getIssuesByProviderId(providerId: string): Observable<IIssuesSummary> {
return this.http.get<IIssuesSummary>(`${this.url}details/${providerId}`, {headers: this.headers});
}
}

@ -0,0 +1,25 @@
<div class='container'>
<div class='chatbox'>
<div class='chatbox__user-list'>
<h1>Users</h1>
<div class='chatbox__user--active' *ngFor="let user of userList">
<p>{{user}}</p>
</div>
</div>
<div class="chatbox-message-box">
<div class="chatbox__messages" *ngFor="let m of messages">
<div class="chatbox__messages__user-message">
<div class="chatbox__messages__user-message--ind-message" [ngClass]="{'sender': m.chatType === ChatType.Sender, 'reciever':m.chatType === ChatType.Reciever }">
<p class="name" *ngIf="m?.username">{{m.username}}</p>
<br/>
<p class="message">{{m.message}}</p>
<p class="timestamp">{{m.date | amLocal | amDateFormat: 'l LT'}}</p>
</div>
</div>
</div>
</div>
<div class="form">
<input type="text" [(ngModel)]="currentMessage" placeholder="Enter your message">
<button mat-raised-button class="add-message" (click)="addMessage()">Send</button>
</div>
</div>

@ -0,0 +1,342 @@
// Variables
$primary: rgba(23, 190, 187, 1);
$secondary: rgba(240, 166, 202, 1);
$active: rgba(23, 190, 187, 0.8);
$busy: rgba(252, 100, 113, 0.8);
$away: rgba(255, 253, 130, 0.8);
// Triangle Mixin
@mixin triangle($color, $size, $direction) {
width: 0;
height: 0;
@if $direction == "up" {
border-right: ($size + px) solid transparent;
border-left: ($size + px) solid transparent;
border-bottom: ($size + px) solid $color;
}
@if $direction == "down" {
border-right: ($size + px) solid transparent;
border-left: ($size + px) solid transparent;
border-top: ($size + px) solid $color;
}
@if $direction == "right" {
border-top: ($size + px) solid transparent;
border-bottom: ($size + px) solid transparent;
border-left: ($size + px) solid $color;
}
@if $direction == "left" {
border-top: ($size + px) solid transparent;
border-bottom: ($size + px) solid transparent;
border-right: ($size + px) solid $color;
}
}
* {
margin: 0; padding: 0;
box-sizing: border-box;
font-family: 'Nunito', sans-serif;
}
html,body {
background: linear-gradient(120deg, $primary, $secondary);
overflow: hidden;
}
.container {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 70vh;
width: 100%;
h1 {
margin: 0.5em auto;
color: #FFF;
text-align: center;
}
}
.chatbox {
background: rgba(255, 255, 255, 0.05);
width: 85%;
height: 100%;
border-radius: 0.2em;
position: relative;
box-shadow: 1px 1px 12px rgba(0, 0, 0, 0.1);
.sender {
float: right;
&:after {
content: '';
position: absolute;
margin: -1.5em -18.98em;
@include triangle(rgba(255, 255, 255, 0.2), 10, left);
}
}
.reciever {
float: left;
&:after {
content: '';
position: absolute;
margin: -1.5em 2.65em;
@include triangle(rgba(255, 255, 255, 0.2), 10, right);
}
}
&__messages__user-message {
width: 450px;
}
&__messages__user-message--ind-message {
background: rgba(255, 255, 255, 0.2);
padding: 1em 0;
height: auto;
width: 65%;
border-radius: 5px;
margin: 2em 1em;
overflow: auto;
& > p.name {
color: #FFF;
font-size: 1em;
}
& > p.message {
color: #FFF;
font-size: 0.7em;
margin: 0 2.8em;
}& > p.timestamp {
color: #FFF;
font-size: 0.7em;
margin: 0 2.8em;
}
}
&__user-list {
background: rgba(255, 255, 255, 0.1);
width: 25%;
height: 100%;
float: right;
border-top-right-radius: 0.2em;
border-bottom-right-radius: 0.2em;
h1 {
background: rgba(255, 255, 255, 0.05);
color: rgba(255, 255, 255, 0.9);
font-size: 0.9em;
padding: 1em;
margin: 0;
font-weight: 300;
text-align: center;
}
}
&__user {
width: 0.5em;
height: 0.5em;
border-radius: 100%;
margin: 1em 0.7em;
&--active {
@extend .chatbox__user;
background: $active;
}
&--busy {
@extend .chatbox__user;
background: $busy;
}
&--away {
@extend .chatbox__user;
background: $away;
}
}
p {
float: left;
text-align: left;
margin: -0.25em 2em;
font-size: 0.7em;
font-weight: 300;
color: #FFF;
width: 200px;
}
.form {
background: #222;
input {
background: rgba(255, 255, 255, 0.03);
position: absolute;
bottom: 0;
left: 0;
border: none;
width: 75%;
padding: 1.2em;
outline: none;
color: rgba(255, 255, 255, 0.9);
font-weight: 300;
}
.add-message {
background: rgba(255, 255, 255, 0.03);
position: absolute;
bottom: 1.5%;
right: 26%;
border: none;
outline: none;
color: rgba(255, 255, 255, 0.9);
font-weight: 300;
}
}
}
// Placeholder Styling
::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.9);
}
:-moz-placeholder {
color: rgba(255, 255, 255, 0.9);
}
::-moz-placeholder {
color: rgba(255, 255, 255, 0.9);
}
:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.9);
}
.chatbox-message-box{
height: 90%;
width: 75%;
position: relative;
overflow-y: scroll;
display:flex;
flex-direction:column-reverse;
}
.chatbox__user-list p{
font-size:12px;
}
// ::-webkit-scrollbar {
// width: 4px;
// }
// ::-webkit-scrollbar-thumb {
// background-color: #4c4c6a;
// border-radius: 2px;
// }
// .chatbox {
// width: 300px;
// height: 400px;
// max-height: 400px;
// display: flex;
// flex-direction: column;
// overflow: hidden;
// box-shadow: 0 0 4px rgba(0,0,0,.14),0 4px 8px rgba(0,0,0,.28);
// }
// .chat-window {
// flex: auto;
// max-height: calc(100% - 60px);
// background: #2f323b;
// overflow: auto;
// }
// .chat-input {
// flex: 0 0 auto;
// height: 60px;
// background: #40434e;
// border-top: 1px solid #2671ff;
// box-shadow: 0 0 4px rgba(0,0,0,.14),0 4px 8px rgba(0,0,0,.28);
// }
// .chat-input input {
// height: 59px;
// line-height: 60px;
// outline: 0 none;
// border: none;
// width: calc(100% - 60px);
// color: white;
// text-indent: 10px;
// font-size: 12pt;
// padding: 0;
// background: #40434e;
// }
// .chat-input button {
// float: right;
// outline: 0 none;
// border: none;
// background: rgba(255,255,255,.25);
// height: 40px;
// width: 40px;
// border-radius: 50%;
// padding: 2px 0 0 0;
// margin: 10px;
// transition: all 0.15s ease-in-out;
// }
// .chat-input input[good] + button {
// box-shadow: 0 0 2px rgba(0,0,0,.12),0 2px 4px rgba(0,0,0,.24);
// background: #2671ff;
// }
// .chat-input input[good] + button:hover {
// box-shadow: 0 8px 17px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
// }
// .chat-input input[good] + button path {
// fill: white;
// }
// .msg-container {
// position: relative;
// display: inline-block;
// width: 100%;
// margin: 0 0 10px 0;
// padding: 0;
// }
// .msg-box {
// display: flex;
// background: #5b5e6c;
// padding: 10px 10px 0 10px;
// border-radius: 0 6px 6px 0;
// max-width: 80%;
// width: auto;
// float: left;
// box-shadow: 0 0 2px rgba(0,0,0,.12),0 2px 4px rgba(0,0,0,.24);
// }
// .user-img {
// display: inline-block;
// border-radius: 50%;
// height: 40px;
// width: 40px;
// background: #2671ff;
// margin: 0 10px 10px 0;
// }
// .flr {
// flex: 1 0 auto;
// display: flex;
// flex-direction: column;
// width: calc(100% - 50px);
// }
// .messages {
// flex: 1 0 auto;
// }
// .msg {
// display: inline-block;
// font-size: 11pt;
// line-height: 13pt;
// color: rgba(255,255,255,.7);
// margin: 0 0 4px 0;
// }
// .msg:first-of-type {
// margin-top: 8px;
// }
// .timestamp {
// color: rgba(0,0,0,.38);
// font-size: 8pt;
// margin-bottom: 10px;
// }
// .username {
// margin-right: 3px;
// }
// .posttime {
// margin-left: 3px;
// }
// .msg-self .msg-box {
// border-radius: 6px 0 0 6px;
// background: #2671ff;
// float: right;
// }
// .msg-self .user-img {
// margin: 0 0 10px 10px;
// }
// .msg-self .msg {
// text-align: right;
// }
// .msg-self .timestamp {
// text-align: right;
// }

@ -0,0 +1,46 @@
import { AfterContentChecked, AfterViewInit, Component, EventEmitter, Inject, Input, OnInit, Output } from "@angular/core";
export interface ChatMessages {
id: number;
message: string;
date: Date;
username: string;
chatType: ChatType;
}
export enum ChatType {
Sender,
Reciever
}
@Component({
selector: "ombi-chat-box",
templateUrl: "chat-box.component.html",
styleUrls: ["chat-box.component.scss"],
})
export class ChatBoxComponent implements OnInit {
@Input() messages: ChatMessages[];
@Output() onAddMessage: EventEmitter<string> = new EventEmitter<string>();
@Output() onDeleteMessage: EventEmitter<number> = new EventEmitter<number>();
public currentMessage: string;
public userList: string[];
public ChatType = ChatType;
public ngOnInit(): void {
const allUsernames = this.messages.map(x => x.username);
this.userList = allUsernames.filter((v, i, a) => a.indexOf(v) === i);
}
public deleteMessage(id: number) {
this.onDeleteMessage.emit(id);
}
public addMessage() {
if (this.currentMessage) {
this.onAddMessage.emit(this.currentMessage);
this.currentMessage = '';
}
}
}

@ -36,11 +36,13 @@ import { MatProgressSpinnerModule } from "@angular/material/progress-spinner";
import { MatSlideToggleModule } from "@angular/material/slide-toggle";
import { MatTabsModule } from "@angular/material/tabs";
import { EpisodeRequestComponent } from "./episode-request/episode-request.component";
import { DetailsGroupComponent } from "../issues/components/details-group/details-group.component";
@NgModule({
declarations: [
IssuesReportComponent,
EpisodeRequestComponent,
DetailsGroupComponent,
],
imports: [
SidebarModule,
@ -76,6 +78,7 @@ import { EpisodeRequestComponent } from "./episode-request/episode-request.compo
],
entryComponents: [
EpisodeRequestComponent,
DetailsGroupComponent,
],
exports: [
TranslateModule,
@ -86,6 +89,7 @@ import { EpisodeRequestComponent } from "./episode-request/episode-request.compo
MatProgressSpinnerModule,
IssuesReportComponent,
EpisodeRequestComponent,
DetailsGroupComponent,
TruncateModule,
InputSwitchModule,
MatTreeModule,

@ -4,18 +4,18 @@
<label class="control-label"><h3>User Details</h3></label>
<div>
<mat-form-field>
<input matInput placeholder="Username" [(ngModel)]="user.userName" required>
<input matInput id="username" placeholder="Username" [(ngModel)]="user.userName" required>
</mat-form-field>
</div>
<div>
<mat-form-field>
<input matInput placeholder="Alias" [(ngModel)]="user.alias"
<input id="alias" matInput placeholder="Alias" [(ngModel)]="user.alias"
matTooltip="This is used as a display value instead of the users username, so think of it as a more friendly username">
</mat-form-field>
</div>
<div>
<mat-form-field>
<input matInput placeholder="Email Address" type="email" [(ngModel)]="user.emailAddress">
<input id="emailAddress" matInput placeholder="Email Address" type="email" [(ngModel)]="user.emailAddress">
</mat-form-field>
</div>
<mat-form-field>
@ -28,12 +28,12 @@
</mat-form-field>
<div>
<mat-form-field>
<input matInput placeholder="Password" type="password" [(ngModel)]="user.password" required>
<input id="password" matInput placeholder="Password" type="password" [(ngModel)]="user.password" required>
</mat-form-field>
</div>
<div>
<mat-form-field>
<input matInput placeholder="Confirm Password" type="password" [(ngModel)]="confirmPass" required>
<input id="confirmPass" matInput placeholder="Confirm Password" type="password" [(ngModel)]="confirmPass" required>
</mat-form-field>
</div>
@ -44,17 +44,17 @@
<label class="control-label"><h3>Request Limits</h3></label>
<div>
<mat-form-field>
<input matInput placeholder="Movie Request Limit" [(ngModel)]="user.movieRequestLimit">
<input id="movieRequestLimit" matInput placeholder="Movie Request Limit" [(ngModel)]="user.movieRequestLimit">
</mat-form-field>
</div>
<div>
<mat-form-field>
<input matInput placeholder="Episode Request Limit" [(ngModel)]="user.episodeRequestLimit">
<input id="episodeRequestLimit" matInput placeholder="Episode Request Limit" [(ngModel)]="user.episodeRequestLimit">
</mat-form-field>
</div>
<div>
<mat-form-field>
<input matInput placeholder="Music Request Limit" [(ngModel)]="user.musicRequestLimit">
<input id="musicRequestLimit" matInput placeholder="Music Request Limit" [(ngModel)]="user.musicRequestLimit">
</mat-form-field>
</div>
<label class="control-label"><h3>Quality & Root Path Preferences</h3></label>
@ -117,13 +117,13 @@
<label class="control-label"><h3>Roles</h3></label>
<div *ngIf="!edit">
<div *ngFor="let c of availableClaims">
<mat-slide-toggle [(ngModel)]="c.enabled">{{c.value | humanize}}</mat-slide-toggle>
<mat-slide-toggle id="role{{c.value}}" [(ngModel)]="c.enabled">{{c.value | humanize}}</mat-slide-toggle>
</div>
</div>
<div *ngIf="edit">
<div *ngFor="let c of user.claims">
<mat-slide-toggle [(ngModel)]="c.enabled">{{c.value | humanize}}</mat-slide-toggle>
<mat-slide-toggle id="role{{c.value}}" [(ngModel)]="c.enabled">{{c.value | humanize}}</mat-slide-toggle>
</div>
</div>
</div>
@ -134,7 +134,7 @@
<div *ngFor="let pref of notificationPreferences">
<div>
<mat-form-field>
<input matInput placeholder="{{NotificationAgent[pref.agent] | humanize}}" [(ngModel)]="pref.value">
<input id="{{NotificationAgent[pref.agent]}}" matInput placeholder="{{NotificationAgent[pref.agent] | humanize}}" [(ngModel)]="pref.value">
</mat-form-field>
</div>
</div>

@ -73,10 +73,10 @@
</ng-container>
<ng-container matColumnDef="lastLoggedIn">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Last Logged In </th>
<td mat-cell *matCellDef="let u">
<td mat-cell *matCellDef="let u">
<span *ngIf="u.lastLoggedIn">
{{u.lastLoggedIn | amLocal | amDateFormat: 'l LT'}}
</span>
</span>
<span *ngIf="!u.lastLoggedIn">
Not logged in yet!
</span> </td>
@ -92,10 +92,10 @@
<span *ngIf="u.userType === 5">Jellyfin User</span>
</td>
</ng-container>
<ng-container matColumnDef="roles">
<th mat-header-cell *matHeaderCellDef> Roles </th>
<td mat-cell *matCellDef="let element">
<td mat-cell *matCellDef="let element">
<div *ngFor="let claim of element.claims">
<span *ngIf="claim.enabled">{{claim.value}}</span>
</div>
@ -105,7 +105,7 @@
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef> </th>
<td mat-cell *matCellDef="let u">
<button mat-raised-button color="accent" [routerLink]="['/usermanagement/user/' + u.id]">Details/Edit</button>
<button id="edit{{u.userName}}" mat-raised-button color="accent" [routerLink]="['/usermanagement/user/' + u.id]">Details/Edit</button>
</td>
</ng-container>
@ -115,7 +115,7 @@
<button *ngIf="!u.hasLoggedIn" mat-raised-button color="accent" (click)="welcomeEmail(u)" [disabled]="!customizationSettings?.applicationUrl">Send Welcome Email</button>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>

@ -25,7 +25,7 @@
</div>
</div>
<div class="welcome-buttons">
<button mat-button matStepperNext class="mat-raised-button mat-accent">Next</button>
<button mat-button matStepperNext class="mat-raised-button mat-accent" data-test="nextWelcome">Next</button>
</div>
</form>
</mat-step>
@ -39,16 +39,16 @@
<mat-tab label="Jellyfin"><wizard-jellyfin></wizard-jellyfin></mat-tab>
</mat-tab-group>
<button mat-button matStepperPrevious class="mat-raised-button mat-error left">Back</button>
<button mat-button matStepperNext class="mat-raised-button mat-accent right">Next</button>
<button mat-button matStepperNext class="mat-raised-button mat-accent right" data-test="nextMediaServer">Next</button>
</form>
</mat-step>
<mat-step>
<mat-step id="userStep">
<form>
<ng-template matStepLabel>Create a local admin</ng-template>
<wizard-local-admin [user]="localUser"></wizard-local-admin>
<div>
<button mat-button matStepperPrevious class="mat-raised-button mat-error left">Back</button>
<button mat-button matStepperNext class="mat-raised-button mat-accent right">Next</button>
<button mat-button matStepperNext class="mat-raised-button mat-accent right" data-test="nextLocalUser">Next</button>
</div>
</form>
</mat-step>
@ -58,7 +58,7 @@
<wizard-ombi [config]="config"></wizard-ombi>
<div>
<button mat-button matStepperPrevious class="mat-raised-button mat-error left">Back</button>
<button mat-button matStepperNext class="mat-raised-button mat-accent right">Next</button>
<button mat-button matStepperNext class="mat-raised-button mat-accent right" data-test="nextOmbiConfig">Next</button>
</div>
</form>
</mat-step>
@ -77,7 +77,7 @@
</div>
</div>
<div>
<button mat-button matStepperPrevious (click)="createUser()" class="mat-raised-button mat-accent right">Finish</button>
<button mat-button matStepperPrevious id="finishWizard" (click)="createUser()" class="mat-raised-button mat-accent right">Finish</button>
<button mat-button (click)="stepper.reset()" class="mat-raised-button mat-error left">Reset</button>
</div>
</mat-step>

@ -15,6 +15,7 @@
<link href="styles/spinkit.css" rel="stylesheet">
<link href="styles/11-folding-cube.css" rel="stylesheet">
<link rel="icon" type="image/png" href="images/favicon/favicon.ico"/>
<link rel="apple-touch-icon" type="image/png" href="images/favicon/apple-touch-icon.png"/>
<script src="styles/please-wait.js"></script>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

@ -633,11 +633,16 @@ namespace Ombi.Controllers.V1
user.MovieRequestLimit = ui.MovieRequestLimit;
user.EpisodeRequestLimit = ui.EpisodeRequestLimit;
user.MusicRequestLimit = ui.MusicRequestLimit;
if (ui.Password.HasValue())
{
user.PasswordHash = UserManager.PasswordHasher.HashPassword(user, ui.Password);
}
if (ui.StreamingCountry.HasValue())
{
user.StreamingCountry = ui.StreamingCountry;
}
var updateResult = await UserManager.UpdateAsync(user);
if (!updateResult.Succeeded)
{
return new OmbiIdentityResult

@ -132,7 +132,8 @@ namespace Ombi.Controllers.V1
i.IssueCategory = null;
i.CreatedDate = DateTime.UtcNow;
var username = User.Identity.Name.ToUpper();
i.UserReportedId = (await _userManager.Users.FirstOrDefaultAsync(x => x.NormalizedUserName == username)).Id;
var reportedUser = await _userManager.Users.FirstOrDefaultAsync(x => x.NormalizedUserName == username);
i.UserReportedId = reportedUser.Id;
await _issues.Add(i);
var category = await _categories.GetAll().FirstOrDefaultAsync(x => i.IssueCategoryId == x.Id);
if (category != null)
@ -142,7 +143,7 @@ namespace Ombi.Controllers.V1
var notificationModel = new NotificationOptions
{
RequestId = i.RequestId ?? 0,
DateTime = DateTime.Now,
DateTime = DateTime.UtcNow,
NotificationType = NotificationType.Issue,
RequestType = i.RequestType,
Recipient = string.Empty,
@ -151,7 +152,7 @@ namespace Ombi.Controllers.V1
};
AddIssueNotificationSubstitutes(notificationModel, i, User.Identity.Name);
AddIssueNotificationSubstitutes(notificationModel, i, reportedUser.UserName, reportedUser.UserAlias);
await _notification.Notify(notificationModel);
@ -242,7 +243,7 @@ namespace Ombi.Controllers.V1
};
var isAdmin = await _userManager.IsInRoleAsync(user, OmbiRoles.Admin) || user.IsSystemUser;
AddIssueNotificationSubstitutes(notificationModel, issue, issue.UserReported.UserAlias);
AddIssueNotificationSubstitutes(notificationModel, issue, user.UserName, user.UserAlias);
notificationModel.Substitutes.Add("NewIssueComment", comment.Comment);
notificationModel.Substitutes.Add("IssueId", comment.IssueId.ToString());
notificationModel.Substitutes.Add("AdminComment", isAdmin.ToString());
@ -278,7 +279,7 @@ namespace Ombi.Controllers.V1
[PowerUser]
public async Task<bool> DeleteIssue(int id)
{
var issue = await _issues.GetAll().FirstOrDefaultAsync(x => x.Id == id);
var issue = await _issues.GetAll().Include(x => x.Comments).FirstOrDefaultAsync(x => x.Id == id);
await _issues.Delete(issue);
return true;
@ -319,7 +320,7 @@ namespace Ombi.Controllers.V1
UserId = issue.UserReported.Id, // This is a resolved notification, so needs to go to the user who raised it
};
AddIssueNotificationSubstitutes(notificationModel, issue, issue.UserReported?.UserAlias ?? string.Empty);
AddIssueNotificationSubstitutes(notificationModel, issue, issue.UserReported?.UserName ?? string.Empty, issue.UserReported.UserAlias);
await _notification.Notify(notificationModel);
}
@ -328,7 +329,7 @@ namespace Ombi.Controllers.V1
return true;
}
private static void AddIssueNotificationSubstitutes(NotificationOptions notificationModel, Issues issue, string issueReportedUsername)
private static void AddIssueNotificationSubstitutes(NotificationOptions notificationModel, Issues issue, string issueReportedUsername, string alias)
{
notificationModel.Substitutes.Add("Title", issue.Title);
notificationModel.Substitutes.Add("IssueDescription", issue.Description);
@ -336,6 +337,7 @@ namespace Ombi.Controllers.V1
notificationModel.Substitutes.Add("IssueStatus", issue.Status.ToString());
notificationModel.Substitutes.Add("IssueSubject", issue.Subject);
notificationModel.Substitutes.Add("IssueUser", issueReportedUsername);
notificationModel.Substitutes.Add("IssueUserAlias", alias);
notificationModel.Substitutes.Add("RequestType", notificationModel.RequestType.ToString());
}
}

@ -0,0 +1,31 @@
using Microsoft.AspNetCore.Mvc;
using Ombi.Core.Engine.V2;
using Ombi.Store.Entities.Requests;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Ombi.Controllers.V2
{
public class IssuesController : V2Controller
{
private readonly IIssuesEngine _engine;
public IssuesController(IIssuesEngine engine)
{
_engine = engine;
}
[HttpGet("{position}/{take}/{status}")]
public Task<IEnumerable<IssuesSummaryModel>> GetIssuesSummary(int position, int take, IssueStatus status)
{
return _engine.GetIssues(position, take, status, HttpContext.RequestAborted);
}
[HttpGet("details/{providerId}")]
public Task<IssuesSummaryModel> GetIssueDetails(string providerId)
{
return _engine.GetIssuesByProviderId(providerId, HttpContext.RequestAborted);
}
}
}

@ -27,9 +27,9 @@ namespace Ombi.Controllers.V2
{
_multiSearchEngine = multiSearchEngine;
_tvSearchEngine = tvSearchEngine;
_tvSearchEngine.ResultLimit = 12;
_tvSearchEngine.ResultLimit = 20;
_movieEngineV2 = v2Movie;
_movieEngineV2.ResultLimit = 12;
_movieEngineV2.ResultLimit = 20;
_tvEngineV2 = v2Tv;
_musicEngine = musicEngine;
_rottenTomatoesApi = rottenTomatoesApi;

@ -293,6 +293,10 @@ namespace Ombi
private static async Task MigrateOldTvDbIds(OmbiContext ctx, GlobalSettings ombiSettingsContent, SettingsContext settingsContext, Api.TheMovieDb.TheMovieDbApi api)
{
if (ombiSettingsContent == null)
{
return;
}
var ombiSettings = JsonConvert.DeserializeObject<OmbiSettings>(ombiSettingsContent.Content);
if (ombiSettings.HasMigratedOldTvDbData)
{

@ -0,0 +1,14 @@
{
"OmbiDatabase": {
"Type": "MySQL",
"ConnectionString": "Server=192.168.68.118;Port=3306;Database=app.ombi.io;User=ombi"
},
"SettingsDatabase": {
"Type": "MySQL",
"ConnectionString": "Server=192.168.68.118;Port=3306;Database=app.ombi.io;User=ombi"
},
"ExternalDatabase": {
"Type": "MySQL",
"ConnectionString": "Server=192.168.68.118;Port=3306;Database=app.ombi.io;User=ombi"
}
}

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
</packageSources>
</configuration>

@ -216,7 +216,9 @@
"MarkedAsResolved": "This issue has now been marked as resolved!",
"MarkedAsInProgress": "This issue has now been marked as in progress!",
"Delete": "Delete issue",
"DeletedIssue": "Issue has been deleted"
"DeletedIssue": "Issue has been deleted",
"Chat":"Chat",
"Requested":"Requested"
},
"Filter": {
"ClearFilter": "Clear Filter",

15
tests/.gitignore vendored

@ -0,0 +1,15 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
# misc
.DS_Store
.idea
npm-debug.log*
yarn-debug.log*
yarn-error.log*
cypress/videos
cypress/screenshots

@ -0,0 +1,23 @@
{
"$schema": "https://on.cypress.io/cypress.schema.json",
"supportFile": "cypress/support/index.ts",
"baseUrl": "http://localhost:3577",
"integrationFolder": "cypress/tests",
"testFiles": "**/*.spec.ts*",
"watchForFileChanges": true,
"chromeWebSecurity": false,
"viewportWidth": 2560,
"viewportHeight": 1440,
"retries": {
"runMode": 2,
"openMode": 0
},
"ignoreTestFiles": [
"**/snapshots/*"
],
"env": {
"username": "a",
"password": "a"
},
"projectId": "o5451s"
}

@ -0,0 +1,20 @@
{
"$schema": "https://on.cypress.io/cypress.schema.json",
"supportFile": "cypress/support/index.ts",
"baseUrl": "https://app.ombi.io/",
"integrationFolder": "cypress/tests",
"testFiles": "**/*.spec.ts*",
"retries": {
"runMode": 2,
"openMode": 1
},
"watchForFileChanges": true,
"chromeWebSecurity": false,
"viewportWidth": 2880,
"viewportHeight": 2160,
"ignoreTestFiles": ["**/snapshots/*"],
"env": {
"username": "beta",
"password": "beta"
}
}

@ -0,0 +1,25 @@
{
"$schema": "https://on.cypress.io/cypress.schema.json",
"supportFile": "cypress/support/index.ts",
"baseUrl": "http://localhost:3577",
"integrationFolder": "cypress/tests",
"testFiles": "**/*.spec.ts*",
"retries": {
"runMode": 2,
"openMode": 1
},
"watchForFileChanges": true,
"projectId": "o5451s",
"viewportWidth": 2560,
"viewportHeight": 1440,
"chromeWebSecurity": false,
"ignoreTestFiles": ["**/snapshots/*"],
"reporter": "junit",
"reporterOptions": {
"mochaFile": "results/junit/regression-[hash].xml"
},
"env": {
"username": "a",
"password": "a"
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,12 @@
[
{
"order": 6,
"streamingProvider": "JamiesNetwork",
"logo": "/hYrcCS72d2alfXdGS1QXNEvwYDY.jpg"
},
{
"order": 3,
"streamingProvider": "Super1",
"logo": "/zLX0ExkHc8xJ9W4u9JgnldDQLKv.jpg"
}
]

@ -0,0 +1,665 @@
[
{
"adult": false,
"backdropPath": "/fev8UFNFFYsD5q7AcYS8LyTzqwl.jpg",
"genreIds": [],
"originalLanguage": "en",
"originalTitle": "Tom & Jerry",
"overview": "Tom the cat and Jerry the mouse get kicked out of their home and relocate to a fancy New York hotel, where a scrappy employee named Kayla will lose her job if she cant evict Jerry before a high-class wedding at the hotel. Her solution? Hiring Tom to get rid of the pesky mouse.",
"popularity": 3387.964111328125,
"posterPath": "/6KErczPBROQty7QoIsaa6wJYXZi.jpg",
"releaseDate": "2021-02-11T00:00:00",
"title": "Tom & Jerry",
"video": false,
"voteAverage": 7.800000190734863,
"voteCount": 717,
"alreadyInCp": false,
"trailer": null,
"homepage": null,
"rootPathOverride": 0,
"qualityOverride": 0,
"type": 1,
"releaseDates": null,
"digitalReleaseDate": null,
"id": 587807,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt1361336",
"theTvDbId": null,
"theMovieDbId": "587807",
"subscribed": false,
"showSubscribe": true
},
{
"adult": false,
"backdropPath": "/7prYzufdIOy1KCTZKVWpjBFqqNr.jpg",
"genreIds": [],
"originalLanguage": "en",
"originalTitle": "Raya and the Last Dragon",
"overview": "Long ago, in the fantasy world of Kumandra, humans and dragons lived together in harmony. But when an evil force threatened the land, the dragons sacrificed themselves to save humanity. Now, 500 years later, that same evil has returned and its up to a lone warrior, Raya, to track down the legendary last dragon to restore the fractured land and its divided people.",
"popularity": 3416.81298828125,
"posterPath": "/lPsD10PP4rgUGiGR4CCXA6iY0QQ.jpg",
"releaseDate": "2021-03-03T00:00:00",
"title": "Raya and the Last Dragon",
"video": false,
"voteAverage": 8.699999809265137,
"voteCount": 734,
"alreadyInCp": false,
"trailer": null,
"homepage": null,
"rootPathOverride": 0,
"qualityOverride": 0,
"type": 1,
"releaseDates": null,
"digitalReleaseDate": null,
"id": 527774,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt5109280",
"theTvDbId": null,
"theMovieDbId": "527774",
"subscribed": false,
"showSubscribe": true
},
{
"adult": false,
"backdropPath": "/8tNX8s3j1O0eqilOQkuroRLyOZA.jpg",
"genreIds": [],
"originalLanguage": "en",
"originalTitle": "Monster Hunter",
"overview": "A portal transports Cpt. Artemis and an elite unit of soldiers to a strange world where powerful monsters rule with deadly ferocity. Faced with relentless danger, the team encounters a mysterious hunter who may be their only hope to find a way home.",
"popularity": 2294.44091796875,
"posterPath": "/1UCOF11QCw8kcqvce8LKOO6pimh.jpg",
"releaseDate": "2020-12-03T00:00:00",
"title": "Monster Hunter",
"video": false,
"voteAverage": 7.300000190734863,
"voteCount": 1036,
"alreadyInCp": false,
"trailer": null,
"homepage": null,
"rootPathOverride": 0,
"qualityOverride": 0,
"type": 1,
"releaseDates": null,
"digitalReleaseDate": null,
"id": 458576,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt6475714",
"theTvDbId": null,
"theMovieDbId": "458576",
"subscribed": false,
"showSubscribe": true
},
{
"adult": false,
"backdropPath": "/srYya1ZlI97Au4jUYAktDe3avyA.jpg",
"genreIds": [],
"originalLanguage": "en",
"originalTitle": "Wonder Woman 1984",
"overview": "A botched store robbery places Wonder Woman in a global battle against a powerful and mysterious ancient force that puts her powers in jeopardy.",
"popularity": 1718.625,
"posterPath": "/8UlWHLMpgZm9bx6QYh0NFoq67TZ.jpg",
"releaseDate": "2020-12-16T00:00:00",
"title": "Wonder Woman 1984",
"video": false,
"voteAverage": 6.900000095367432,
"voteCount": 4139,
"alreadyInCp": false,
"trailer": null,
"homepage": null,
"rootPathOverride": 0,
"qualityOverride": 0,
"type": 1,
"releaseDates": null,
"digitalReleaseDate": null,
"id": 464052,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt7126948",
"theTvDbId": null,
"theMovieDbId": "464052",
"subscribed": false,
"showSubscribe": true
},
{
"adult": false,
"backdropPath": "/drulhSX7P5TQlEMQZ3JoXKSDEfz.jpg",
"genreIds": [],
"originalLanguage": "ko",
"originalTitle": "승리호",
"overview": "When the crew of a space junk collector ship called The Victory discovers a humanoid robot named Dorothy that's known to be a weapon of mass destruction, they get involved in a risky business deal which puts their lives at stake.",
"popularity": 1481.4510498046875,
"posterPath": "/y2Yp7KC2FJSsdlRM5qkkIwQGCqU.jpg",
"releaseDate": "2021-02-05T00:00:00",
"title": "Space Sweepers",
"video": false,
"voteAverage": 7.400000095367432,
"voteCount": 353,
"alreadyInCp": false,
"trailer": null,
"homepage": null,
"rootPathOverride": 0,
"qualityOverride": 0,
"type": 1,
"releaseDates": null,
"digitalReleaseDate": null,
"id": 581389,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt12838766",
"theTvDbId": null,
"theMovieDbId": "581389",
"subscribed": false,
"showSubscribe": true
},
{
"adult": false,
"backdropPath": "/7KL4yJ4JsbtS1BNRilUApLvMnc5.jpg",
"genreIds": [],
"originalLanguage": "sv",
"originalTitle": "Red Dot",
"overview": "On a hiking trip to rekindle their marriage, a couple find themselves fleeing for their lives in the unforgiving wilderness from an unknown shooter.",
"popularity": 1416.6009521484375,
"posterPath": "/xZ2KER2gOHbuHP2GJoODuXDSZCb.jpg",
"releaseDate": "2021-02-11T00:00:00",
"title": "Red Dot",
"video": false,
"voteAverage": 6.5,
"voteCount": 307,
"alreadyInCp": false,
"trailer": null,
"homepage": null,
"rootPathOverride": 0,
"qualityOverride": 0,
"type": 1,
"releaseDates": null,
"digitalReleaseDate": null,
"id": 649087,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt11307814",
"theTvDbId": null,
"theMovieDbId": "649087",
"subscribed": false,
"showSubscribe": true
},
{
"adult": false,
"backdropPath": "/vKzbIoHhk1z9DWYi8kyFe9Gg0HF.jpg",
"genreIds": [],
"originalLanguage": "en",
"originalTitle": "Coming 2 America",
"overview": "Prince Akeem Joffer is set to become King of Zamunda when he discovers he has a son he never knew about in America a street savvy Queens native named Lavelle. Honoring his royal father's dying wish to groom this son as the crown prince, Akeem and Semmi set off to America once again.",
"popularity": 2243.493896484375,
"posterPath": "/nWBPLkqNApY5pgrJFMiI9joSI30.jpg",
"releaseDate": "2021-03-05T00:00:00",
"title": "Coming 2 America",
"video": false,
"voteAverage": 7.099999904632568,
"voteCount": 552,
"alreadyInCp": false,
"trailer": null,
"homepage": null,
"rootPathOverride": 0,
"qualityOverride": 0,
"type": 1,
"releaseDates": null,
"digitalReleaseDate": null,
"id": 484718,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt6802400",
"theTvDbId": null,
"theMovieDbId": "484718",
"subscribed": false,
"showSubscribe": true
},
{
"adult": false,
"backdropPath": "/lOSdUkGQmbAl5JQ3QoHqBZUbZhC.jpg",
"genreIds": [],
"originalLanguage": "en",
"originalTitle": "Outside the Wire",
"overview": "In the near future, a drone pilot is sent into a deadly militarized zone and must work with an android officer to locate a doomsday device.",
"popularity": 1121.386962890625,
"posterPath": "/6XYLiMxHAaCsoyrVo38LBWMw2p8.jpg",
"releaseDate": "2021-01-15T00:00:00",
"title": "Outside the Wire",
"video": false,
"voteAverage": 6.5,
"voteCount": 812,
"alreadyInCp": false,
"trailer": null,
"homepage": null,
"rootPathOverride": 0,
"qualityOverride": 0,
"type": 1,
"releaseDates": null,
"digitalReleaseDate": null,
"id": 775996,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt10451914",
"theTvDbId": null,
"theMovieDbId": "775996",
"subscribed": false,
"showSubscribe": true
},
{
"adult": false,
"backdropPath": "/vfuzELmhBjBTswXj2Vqxnu5ge4g.jpg",
"genreIds": [],
"originalLanguage": "en",
"originalTitle": "The Little Things",
"overview": "Deputy Sheriff Joe \"Deke\" Deacon joins forces with Sgt. Jim Baxter to search for a serial killer who's terrorizing Los Angeles. As they track the culprit, Baxter is unaware that the investigation is dredging up echoes of Deke's past, uncovering disturbing secrets that could threaten more than his case.",
"popularity": 977.3709716796875,
"posterPath": "/c7VlGCCgM9GZivKSzBgzuOVxQn7.jpg",
"releaseDate": "2021-01-28T00:00:00",
"title": "The Little Things",
"video": false,
"voteAverage": 6.5,
"voteCount": 509,
"alreadyInCp": false,
"trailer": null,
"homepage": null,
"rootPathOverride": 0,
"qualityOverride": 0,
"type": 1,
"releaseDates": null,
"digitalReleaseDate": null,
"id": 602269,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt10016180",
"theTvDbId": null,
"theMovieDbId": "602269",
"subscribed": false,
"showSubscribe": true
},
{
"adult": false,
"backdropPath": "/6TPZSJ06OEXeelx1U1VIAt0j9Ry.jpg",
"genreIds": [],
"originalLanguage": "es",
"originalTitle": "Bajocero",
"overview": "When a prisoner transfer van is attacked, the cop in charge must fight those inside and outside while dealing with a silent foe: the icy temperatures.",
"popularity": 877.6370239257812,
"posterPath": "/dWSnsAGTfc8U27bWsy2RfwZs0Bs.jpg",
"releaseDate": "2021-01-29T00:00:00",
"title": "Below Zero",
"video": false,
"voteAverage": 6.5,
"voteCount": 414,
"alreadyInCp": false,
"trailer": null,
"homepage": null,
"rootPathOverride": 0,
"qualityOverride": 0,
"type": 1,
"releaseDates": null,
"digitalReleaseDate": null,
"id": 587996,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt9845564",
"theTvDbId": null,
"theMovieDbId": "587996",
"subscribed": false,
"showSubscribe": true
},
{
"adult": false,
"backdropPath": "/fRrpOILyXuWaWLmqF7kXeMVwITQ.jpg",
"genreIds": [],
"originalLanguage": "en",
"originalTitle": "Black Water: Abyss",
"overview": "An adventure-loving couple convince their friends to explore a remote, uncharted cave system in the forests of Northern Australia. With a tropical storm approaching, they abseil into the mouth of the cave, but when the caves start to flood, tensions rise as oxygen levels fall and the friends find themselves trapped. Unknown to them, the storm has also brought in a pack of dangerous and hungry crocodiles.",
"popularity": 872.2529907226562,
"posterPath": "/95S6PinQIvVe4uJAd82a2iGZ0rA.jpg",
"releaseDate": "2020-07-09T00:00:00",
"title": "Black Water: Abyss",
"video": false,
"voteAverage": 5.099999904632568,
"voteCount": 155,
"alreadyInCp": false,
"trailer": null,
"homepage": null,
"rootPathOverride": 0,
"qualityOverride": 0,
"type": 1,
"releaseDates": null,
"digitalReleaseDate": null,
"id": 522444,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt7978672",
"theTvDbId": null,
"theMovieDbId": "522444",
"subscribed": false,
"showSubscribe": true
},
{
"adult": false,
"backdropPath": "/nz8xWrTKZzA5A7FgxaM4kfAoO1W.jpg",
"genreIds": [],
"originalLanguage": "en",
"originalTitle": "Breach",
"overview": "A hardened mechanic must stay awake and maintain an interstellar ark fleeing the dying planet Earth with a few thousand lucky souls on board... the last of humanity. Unfortunately, humans are not the only passengers. A shapeshifting alien creature has taken residence, its only goal is to kill as many people as possible. The crew must think quickly to stop this menace before it destroys mankind.",
"popularity": 794.0670166015625,
"posterPath": "/13B6onhL6FzSN2KaNeQeMML05pS.jpg",
"releaseDate": "2020-12-17T00:00:00",
"title": "Breach",
"video": false,
"voteAverage": 4.5,
"voteCount": 292,
"alreadyInCp": false,
"trailer": null,
"homepage": null,
"rootPathOverride": 0,
"qualityOverride": 0,
"type": 1,
"releaseDates": null,
"digitalReleaseDate": null,
"id": 651571,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt9820556",
"theTvDbId": null,
"theMovieDbId": "651571",
"subscribed": false,
"showSubscribe": true
},
{
"adult": false,
"backdropPath": "/3ombg55JQiIpoPnXYb2oYdr6DtP.jpg",
"genreIds": [],
"originalLanguage": "en",
"originalTitle": "Skylines",
"overview": "When a virus threatens to turn the now earth-dwelling friendly alien hybrids against humans, Captain Rose Corley must lead a team of elite mercenaries on a mission to the alien world in order to save what's left of humanity.",
"popularity": 745.0089721679688,
"posterPath": "/2W4ZvACURDyhiNnSIaFPHfNbny3.jpg",
"releaseDate": "2020-10-25T00:00:00",
"title": "Skylines",
"video": false,
"voteAverage": 6.099999904632568,
"voteCount": 210,
"alreadyInCp": false,
"trailer": null,
"homepage": null,
"rootPathOverride": 0,
"qualityOverride": 0,
"type": 1,
"releaseDates": null,
"digitalReleaseDate": null,
"id": 560144,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt9387250",
"theTvDbId": null,
"theMovieDbId": "560144",
"subscribed": false,
"showSubscribe": true
},
{
"adult": false,
"backdropPath": "/jeAQdDX9nguP6YOX6QSWKDPkbBo.jpg",
"genreIds": [],
"originalLanguage": "en",
"originalTitle": "Jiu Jitsu",
"overview": "Every six years, an ancient order of jiu-jitsu fighters joins forces to battle a vicious race of alien invaders. But when a celebrated war hero goes down in defeat, the fate of the planet and mankind hangs in the balance.",
"popularity": 753.3040161132812,
"posterPath": "/eLT8Cu357VOwBVTitkmlDEg32Fs.jpg",
"releaseDate": "2020-11-20T00:00:00",
"title": "Jiu Jitsu",
"video": false,
"voteAverage": 5.300000190734863,
"voteCount": 308,
"alreadyInCp": false,
"trailer": null,
"homepage": null,
"rootPathOverride": 0,
"qualityOverride": 0,
"type": 1,
"releaseDates": null,
"digitalReleaseDate": null,
"id": 590706,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt9624766",
"theTvDbId": null,
"theMovieDbId": "590706",
"subscribed": false,
"showSubscribe": true
},
{
"adult": false,
"backdropPath": "/kf456ZqeC45XTvo6W9pW5clYKfQ.jpg",
"genreIds": [],
"originalLanguage": "en",
"originalTitle": "Soul",
"overview": "Joe Gardner is a middle school teacher with a love for jazz music. After a successful gig at the Half Note Club, he suddenly gets into an accident that separates his soul from his body and is transported to the You Seminar, a center in which souls develop and gain passions before being transported to a newborn child. Joe must enlist help from the other souls-in-training, like 22, a soul who has spent eons in the You Seminar, in order to get back to Earth.",
"popularity": 722.4119873046875,
"posterPath": "/hm58Jw4Lw8OIeECIq5qyPYhAeRJ.jpg",
"releaseDate": "2020-12-25T00:00:00",
"title": "Soul",
"video": false,
"voteAverage": 8.300000190734863,
"voteCount": 5164,
"alreadyInCp": false,
"trailer": null,
"homepage": null,
"rootPathOverride": 0,
"qualityOverride": 0,
"type": 1,
"releaseDates": null,
"digitalReleaseDate": null,
"id": 508442,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt2948372",
"theTvDbId": null,
"theMovieDbId": "508442",
"subscribed": false,
"showSubscribe": true
},
{
"adult": false,
"backdropPath": "/psTz3J2QXVKTQCGrPDFuC4kAOLb.jpg",
"genreIds": [],
"originalLanguage": "en",
"originalTitle": "Scooby-Doo! The Sword and the Scoob",
"overview": "An evil sorceress transports the gang back to the age of chivalrous knights, spell-casting wizards, and fire-breathing dragons.",
"popularity": 678.906982421875,
"posterPath": "/sCoG0ibohbPrnyomtzegSuBL40L.jpg",
"releaseDate": "2021-02-22T00:00:00",
"title": "Scooby-Doo! The Sword and the Scoob",
"video": false,
"voteAverage": 7.599999904632568,
"voteCount": 21,
"alreadyInCp": false,
"trailer": null,
"homepage": null,
"rootPathOverride": 0,
"qualityOverride": 0,
"type": 1,
"releaseDates": null,
"digitalReleaseDate": null,
"id": 682254,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt13676256",
"theTvDbId": null,
"theMovieDbId": "682254",
"subscribed": false,
"showSubscribe": true
},
{
"adult": false,
"backdropPath": "/fX8e94MEWSuTJExndVYxKsmA4Hw.jpg",
"genreIds": [],
"originalLanguage": "zh",
"originalTitle": "急先锋",
"overview": "Covert security company Vanguard is the last hope of survival for an accountant after he is targeted by the world's deadliest mercenary organization.",
"popularity": 714.8920288085938,
"posterPath": "/vYvppZMvXYheYTWVd8Rnn9nsmNp.jpg",
"releaseDate": "2020-09-30T00:00:00",
"title": "Vanguard",
"video": false,
"voteAverage": 6.400000095367432,
"voteCount": 225,
"alreadyInCp": false,
"trailer": null,
"homepage": null,
"rootPathOverride": 0,
"qualityOverride": 0,
"type": 1,
"releaseDates": null,
"digitalReleaseDate": null,
"id": 604822,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt9695722",
"theTvDbId": null,
"theMovieDbId": "604822",
"subscribed": false,
"showSubscribe": true
}
]

@ -0,0 +1,750 @@
[
{
"title": "Game of Thrones",
"aliases": null,
"banner": null,
"seriesId": 0,
"status": "ended",
"firstAired": "2011-04-18T01:00:00",
"network": "HBO",
"networkId": null,
"runtime": "60",
"genre": null,
"overview": "Seven noble families fight for control of the mythical land of Westeros. Friction between the houses leads to full-scale war. All while a very ancient evil awakens in the farthest north. Amidst the war, a neglected military order of misfits, the Night's Watch, is all that stands between the realms of men and icy horrors beyond.",
"lastUpdated": 0,
"airsDayOfWeek": null,
"airsTime": "21:00",
"rating": "9.10556",
"siteRating": 0,
"trailer": "https://youtube.com/watch?v=bjqEWgDVPe0",
"homepage": "https://www.hbo.com/game-of-thrones",
"seasonRequests": [],
"requestAll": false,
"firstSeason": false,
"latestSeason": false,
"fullyAvailable": false,
"partlyAvailable": false,
"type": 0,
"backdropPath": null,
"id": 121361,
"approved": true,
"denied": false,
"deniedReason": null,
"requested": true,
"requestId": 1,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt0944947",
"theTvDbId": "121361",
"theMovieDbId": null,
"subscribed": false,
"showSubscribe": false
},
{
"title": "Breaking Bad",
"aliases": null,
"banner": null,
"seriesId": 0,
"status": "ended",
"firstAired": "2008-01-21T02:00:00",
"network": "AMC",
"networkId": null,
"runtime": "45",
"genre": null,
"overview": "When Walter White, a New Mexico chemistry teacher, is diagnosed with Stage III cancer and given a prognosis of only two years left to live. He becomes filled with a sense of fearlessness and an unrelenting desire to secure his family's financial future at any cost as he enters the dangerous world of drugs and crime.",
"lastUpdated": 0,
"airsDayOfWeek": null,
"airsTime": "21:00",
"rating": "9.28991",
"siteRating": 0,
"trailer": "https://youtube.com/watch?v=XZ8daibM3AE",
"homepage": "https://www.amc.com/shows/breaking-bad",
"seasonRequests": [],
"requestAll": false,
"firstSeason": false,
"latestSeason": false,
"fullyAvailable": false,
"partlyAvailable": false,
"type": 0,
"backdropPath": null,
"id": 81189,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt0903747",
"theTvDbId": "81189",
"theMovieDbId": null,
"subscribed": false,
"showSubscribe": false
},
{
"title": "The Walking Dead",
"aliases": null,
"banner": null,
"seriesId": 0,
"status": "returning series",
"firstAired": "2010-11-01T01:00:00",
"network": "AMC",
"networkId": null,
"runtime": "42",
"genre": null,
"overview": "Sheriff's deputy Rick Grimes awakens from a coma to find a post-apocalyptic world dominated by flesh-eating zombies. He sets out to find his family and encounters many other survivors along the way.",
"lastUpdated": 0,
"airsDayOfWeek": null,
"airsTime": "21:00",
"rating": "8.18472269269855",
"siteRating": 0,
"trailer": "https://youtube.com/watch?v=R1v0uFms68U",
"homepage": "https://www.amc.com/shows/the-walking-dead",
"seasonRequests": [],
"requestAll": false,
"firstSeason": false,
"latestSeason": false,
"fullyAvailable": false,
"partlyAvailable": false,
"type": 0,
"backdropPath": null,
"id": 153021,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt1520211",
"theTvDbId": "153021",
"theMovieDbId": null,
"subscribed": false,
"showSubscribe": false
},
{
"title": "The Big Bang Theory",
"aliases": null,
"banner": null,
"seriesId": 0,
"status": "ended",
"firstAired": "2007-09-25T00:00:00",
"network": "CBS",
"networkId": null,
"runtime": "25",
"genre": null,
"overview": "A woman who moves into an apartment across the hall from two brilliant but socially awkward physicists shows them how little they know about life outside of the laboratory.",
"lastUpdated": 0,
"airsDayOfWeek": null,
"airsTime": "20:00",
"rating": "8.14052",
"siteRating": 0,
"trailer": "https://youtube.com/watch?v=3g2yTcg1QFI",
"homepage": "https://www.cbs.com/shows/big_bang_theory/",
"seasonRequests": [],
"requestAll": false,
"firstSeason": false,
"latestSeason": false,
"fullyAvailable": false,
"partlyAvailable": false,
"type": 0,
"backdropPath": null,
"id": 80379,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt0898266",
"theTvDbId": "80379",
"theMovieDbId": null,
"subscribed": false,
"showSubscribe": false
},
{
"title": "Sherlock",
"aliases": null,
"banner": null,
"seriesId": 0,
"status": "ended",
"firstAired": "2010-07-25T20:00:00",
"network": "BBC One",
"networkId": null,
"runtime": "90",
"genre": null,
"overview": "A modern update finds the famous sleuth and his doctor partner solving crime in 21st century London.",
"lastUpdated": 0,
"airsDayOfWeek": null,
"airsTime": "21:00",
"rating": "9.043281293560078",
"siteRating": 0,
"trailer": "https://youtube.com/watch?v=xK7S9mrFWL4",
"homepage": "https://www.bbc.co.uk/programmes/b018ttws",
"seasonRequests": [],
"requestAll": false,
"firstSeason": false,
"latestSeason": false,
"fullyAvailable": false,
"partlyAvailable": false,
"type": 0,
"backdropPath": null,
"id": 176941,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt1475582",
"theTvDbId": "176941",
"theMovieDbId": null,
"subscribed": false,
"showSubscribe": false
},
{
"title": "How I Met Your Mother",
"aliases": null,
"banner": null,
"seriesId": 0,
"status": "ended",
"firstAired": "2005-09-20T00:00:00",
"network": "CBS",
"networkId": null,
"runtime": "22",
"genre": null,
"overview": "A father recounts to his children - through a series of flashbacks - the journey he and his four best friends took leading up to him meeting their mother.",
"lastUpdated": 0,
"airsDayOfWeek": null,
"airsTime": "20:00",
"rating": "8.24396",
"siteRating": 0,
"trailer": "https://youtube.com/watch?v=XgUmyAGwxgw",
"homepage": "https://www.cbs.com/shows/how_i_met_your_mother/",
"seasonRequests": [],
"requestAll": false,
"firstSeason": false,
"latestSeason": false,
"fullyAvailable": false,
"partlyAvailable": false,
"type": 0,
"backdropPath": null,
"id": 75760,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt0460649",
"theTvDbId": "75760",
"theMovieDbId": null,
"subscribed": false,
"showSubscribe": false
},
{
"title": "Dexter",
"aliases": null,
"banner": null,
"seriesId": 0,
"status": "ended",
"firstAired": "2006-10-02T01:00:00",
"network": "Showtime",
"networkId": null,
"runtime": "50",
"genre": null,
"overview": "Dexter Morgan, a blood spatter pattern analyst for the Miami Metro Police also leads a secret life as a serial killer, hunting down criminals who have slipped through the cracks of justice.",
"lastUpdated": 0,
"airsDayOfWeek": null,
"airsTime": "21:00",
"rating": "8.56617",
"siteRating": 0,
"trailer": "https://youtube.com/watch?v=YQeUmSD1c3g",
"homepage": "https://www.sho.com/dexter",
"seasonRequests": [],
"requestAll": false,
"firstSeason": false,
"latestSeason": false,
"fullyAvailable": false,
"partlyAvailable": false,
"type": 0,
"backdropPath": null,
"id": 79349,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt0773262",
"theTvDbId": "79349",
"theMovieDbId": null,
"subscribed": false,
"showSubscribe": false
},
{
"title": "Friends",
"aliases": null,
"banner": null,
"seriesId": 0,
"status": "ended",
"firstAired": "1994-09-23T00:00:00",
"network": "NBC",
"networkId": null,
"runtime": "25",
"genre": null,
"overview": "The misadventures of a group of friends as they navigate the pitfalls of work, life and love in Manhattan.",
"lastUpdated": 0,
"airsDayOfWeek": null,
"airsTime": "20:00",
"rating": "8.72021",
"siteRating": 0,
"trailer": "https://youtube.com/watch?v=hDNNmeeJs1Q",
"homepage": "",
"seasonRequests": [],
"requestAll": false,
"firstSeason": false,
"latestSeason": false,
"fullyAvailable": false,
"partlyAvailable": false,
"type": 0,
"backdropPath": null,
"id": 79168,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt0108778",
"theTvDbId": "79168",
"theMovieDbId": null,
"subscribed": false,
"showSubscribe": false
},
{
"title": "Stranger Things",
"aliases": null,
"banner": null,
"seriesId": 0,
"status": "returning series",
"firstAired": "2016-07-15T07:00:00",
"network": "Netflix",
"networkId": null,
"runtime": "50",
"genre": null,
"overview": "When a young boy vanishes, a small town uncovers a mystery involving secret experiments, terrifying supernatural forces, and one strange little girl.",
"lastUpdated": 0,
"airsDayOfWeek": null,
"airsTime": "03:00",
"rating": "8.705786185554972",
"siteRating": 0,
"trailer": "https://youtube.com/watch?v=b9EkMc79ZSU",
"homepage": "https://www.netflix.com/title/80057281",
"seasonRequests": [],
"requestAll": false,
"firstSeason": false,
"latestSeason": false,
"fullyAvailable": false,
"partlyAvailable": false,
"type": 0,
"backdropPath": null,
"id": 305288,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt4574334",
"theTvDbId": "305288",
"theMovieDbId": null,
"subscribed": false,
"showSubscribe": false
},
{
"title": "Arrow",
"aliases": null,
"banner": null,
"seriesId": 0,
"status": "ended",
"firstAired": "2012-10-11T01:00:00",
"network": "The CW",
"networkId": null,
"runtime": "42",
"genre": null,
"overview": "Spoiled billionaire playboy Oliver Queen is missing and presumed dead when his yacht is lost at sea. He returns five years later a changed man, determined to clean up the city as a hooded vigilante armed with a bow.",
"lastUpdated": 0,
"airsDayOfWeek": null,
"airsTime": "21:00",
"rating": "7.70376",
"siteRating": 0,
"trailer": "https://youtube.com/watch?v=hTv13EjlLNg",
"homepage": "https://www.cwtv.com/shows/arrow",
"seasonRequests": [],
"requestAll": false,
"firstSeason": false,
"latestSeason": false,
"fullyAvailable": false,
"partlyAvailable": false,
"type": 0,
"backdropPath": null,
"id": 257655,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt2193021",
"theTvDbId": "257655",
"theMovieDbId": null,
"subscribed": false,
"showSubscribe": false
},
{
"title": "Lost",
"aliases": null,
"banner": null,
"seriesId": 0,
"status": "ended",
"firstAired": "2004-09-23T01:00:00",
"network": "ABC",
"networkId": null,
"runtime": "42",
"genre": null,
"overview": "Stripped of everything, the survivors of a horrific plane crash must work together to stay alive. But the island holds many secrets.",
"lastUpdated": 0,
"airsDayOfWeek": null,
"airsTime": "21:00",
"rating": "8.23659",
"siteRating": 0,
"trailer": "https://youtube.com/watch?v=72kQIIDBIUU",
"homepage": "https://abc.go.com/shows/lost",
"seasonRequests": [],
"requestAll": false,
"firstSeason": false,
"latestSeason": false,
"fullyAvailable": false,
"partlyAvailable": false,
"type": 0,
"backdropPath": null,
"id": 73739,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt0411008",
"theTvDbId": "73739",
"theMovieDbId": null,
"subscribed": false,
"showSubscribe": false
},
{
"title": "House",
"aliases": null,
"banner": null,
"seriesId": 0,
"status": "ended",
"firstAired": "2004-11-17T02:00:00",
"network": "FOX",
"networkId": null,
"runtime": "45",
"genre": null,
"overview": "Dr. Gregory House is a maverick physician who is devoid of bedside manner. While his behavior can border on antisocial, Dr. House thrives on the challenge of solving the medical puzzles that other doctors give up on. Together with his hand-picked team of young medical experts, he'll do whatever it takes in the race against the clock to solve the case.",
"lastUpdated": 0,
"airsDayOfWeek": null,
"airsTime": "21:00",
"rating": "8.66596",
"siteRating": 0,
"trailer": "https://youtube.com/watch?v=MczMB8nU1sY",
"homepage": "https://www.fox.com/house/index.htm",
"seasonRequests": [],
"requestAll": false,
"firstSeason": false,
"latestSeason": false,
"fullyAvailable": false,
"partlyAvailable": false,
"type": 0,
"backdropPath": null,
"id": 73255,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt0412142",
"theTvDbId": "73255",
"theMovieDbId": null,
"subscribed": false,
"showSubscribe": false
},
{
"title": "Homeland",
"aliases": null,
"banner": null,
"seriesId": 0,
"status": "ended",
"firstAired": "2011-10-03T01:00:00",
"network": "Showtime",
"networkId": null,
"runtime": "45",
"genre": null,
"overview": "CIA officer Carrie Mathison is tops in her field despite being bipolar, which makes her volatile and unpredictable. With the help of her long-time mentor Saul Berenson, Carrie fearlessly risks everything, including her personal well-being and even sanity, at every turn.",
"lastUpdated": 0,
"airsDayOfWeek": null,
"airsTime": "21:00",
"rating": "8.343610105492623",
"siteRating": 0,
"trailer": "https://youtube.com/watch?v=KyFmS3wRPCQ",
"homepage": "https://www.sho.com/sho/homeland/home",
"seasonRequests": [],
"requestAll": false,
"firstSeason": false,
"latestSeason": false,
"fullyAvailable": false,
"partlyAvailable": false,
"type": 0,
"backdropPath": null,
"id": 247897,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt1796960",
"theTvDbId": "247897",
"theMovieDbId": null,
"subscribed": false,
"showSubscribe": false
},
{
"title": "House of Cards",
"aliases": null,
"banner": null,
"seriesId": 0,
"status": "ended",
"firstAired": "2013-02-01T08:00:00",
"network": "Netflix",
"networkId": null,
"runtime": "50",
"genre": null,
"overview": "Set in present day Washington, D.C., House of Cards is the story of Frank Underwood, a ruthless and cunning politician, and his wife Claire who will stop at nothing to conquer everything. This wicked political drama penetrates the shadowy world of greed, sex and corruption in modern D.C.",
"lastUpdated": 0,
"airsDayOfWeek": null,
"airsTime": "03:00",
"rating": "8.667647295881357",
"siteRating": 0,
"trailer": "https://youtube.com/watch?v=x1E8PSGcyqI",
"homepage": "https://www.netflix.com/title/70178217",
"seasonRequests": [],
"requestAll": false,
"firstSeason": false,
"latestSeason": false,
"fullyAvailable": false,
"partlyAvailable": false,
"type": 0,
"backdropPath": null,
"id": 262980,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt1856010",
"theTvDbId": "262980",
"theMovieDbId": null,
"subscribed": false,
"showSubscribe": false
},
{
"title": "Supernatural",
"aliases": null,
"banner": null,
"seriesId": 0,
"status": "ended",
"firstAired": "2005-09-14T00:00:00",
"network": "The CW",
"networkId": null,
"runtime": "45",
"genre": null,
"overview": "When they were boys, Sam and Dean Winchester lost their mother to a mysterious and demonic supernatural force. Subsequently, their father raised them to be soldiers. He taught them about the paranormal evil that lives in the dark corners and on the back roads of America ... and he taught them how to kill it. Now, the Winchester brothers crisscross the country in their '67 Chevy Impala, battling every kind of supernatural threat they encounter along the way.",
"lastUpdated": 0,
"airsDayOfWeek": null,
"airsTime": "20:00",
"rating": "8.448307891123497",
"siteRating": 0,
"trailer": "",
"homepage": "https://www.cwtv.com/shows/supernatural",
"seasonRequests": [],
"requestAll": false,
"firstSeason": false,
"latestSeason": false,
"fullyAvailable": false,
"partlyAvailable": false,
"type": 0,
"backdropPath": null,
"id": 78901,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt0460681",
"theTvDbId": "78901",
"theMovieDbId": null,
"subscribed": false,
"showSubscribe": false
},
{
"title": "Fringe",
"aliases": null,
"banner": null,
"seriesId": 0,
"status": "ended",
"firstAired": "2008-09-10T01:00:00",
"network": "FOX",
"networkId": null,
"runtime": "46",
"genre": null,
"overview": "FBI Special Agent Olivia Dunham, brilliant but formerly institutionalized scientist Walter Bishop and his scheming, reluctant son Peter uncover a deadly mystery involving a series of unbelievable events and realize they may be a part of a larger, more disturbing pattern that blurs the line between science fiction and technology.",
"lastUpdated": 0,
"airsDayOfWeek": null,
"airsTime": "21:00",
"rating": "8.697706364733797",
"siteRating": 0,
"trailer": "https://youtube.com/watch?v=29bSzbqZ3xE",
"homepage": "https://www.fox.com/fringe",
"seasonRequests": [],
"requestAll": false,
"firstSeason": false,
"latestSeason": false,
"fullyAvailable": false,
"partlyAvailable": false,
"type": 0,
"backdropPath": null,
"id": 82066,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt1119644",
"theTvDbId": "82066",
"theMovieDbId": null,
"subscribed": false,
"showSubscribe": false
},
{
"title": "Suits",
"aliases": null,
"banner": null,
"seriesId": 0,
"status": "ended",
"firstAired": "2011-06-24T01:00:00",
"network": "USA Network",
"networkId": null,
"runtime": "43",
"genre": null,
"overview": "College drop-out Mike Ross accidentally lands a job with one of New York's best legal closers, Harvey Specter. They soon become a winning team with Mike's raw talent and photographic memory, and Mike soon reminds Harvey of why he went into the field of law in the first place.",
"lastUpdated": 0,
"airsDayOfWeek": null,
"airsTime": "21:00",
"rating": "8.55011",
"siteRating": 0,
"trailer": "https://youtube.com/watch?v=2Q18TnxZxLI",
"homepage": "https://www.usanetwork.com/suits",
"seasonRequests": [],
"requestAll": false,
"firstSeason": false,
"latestSeason": false,
"fullyAvailable": false,
"partlyAvailable": false,
"type": 0,
"backdropPath": null,
"id": 247808,
"approved": false,
"denied": null,
"deniedReason": null,
"requested": false,
"requestId": 0,
"available": false,
"plexUrl": null,
"embyUrl": null,
"jellyfinUrl": null,
"quality": null,
"imdbId": "tt1632701",
"theTvDbId": "247808",
"theMovieDbId": null,
"subscribed": false,
"showSubscribe": false
}
]

@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}

@ -0,0 +1,10 @@
{
"allowNoPassword": false,
"requireDigit": false,
"requiredLength": 0,
"requireLowercase": false,
"requireNonAlphanumeric": false,
"requireUppercase": false,
"enableOAuth": true,
"id": 14
}

@ -0,0 +1,10 @@
{
"enabled": false,
"noticeEnabled": false,
"noticeText": "Hey what's up!\n<br>\n<br>\nThe username and password is beta\n<br>\n<br>\nEnjoy!",
"timeLimit": false,
"startDateTime": "0001-01-01T00:00:00",
"endDateTime": "0001-01-01T00:00:00",
"expired": false,
"id": 0
}

@ -0,0 +1,299 @@
/// <reference types="cypress" />
context('Actions', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/actions')
})
// https://on.cypress.io/interacting-with-elements
it('.type() - type into a DOM element', () => {
// https://on.cypress.io/type
cy.get('.action-email')
.type('fake@email.com').should('have.value', 'fake@email.com')
// .type() with special character sequences
.type('{leftarrow}{rightarrow}{uparrow}{downarrow}')
.type('{del}{selectall}{backspace}')
// .type() with key modifiers
.type('{alt}{option}') //these are equivalent
.type('{ctrl}{control}') //these are equivalent
.type('{meta}{command}{cmd}') //these are equivalent
.type('{shift}')
// Delay each keypress by 0.1 sec
.type('slow.typing@email.com', { delay: 100 })
.should('have.value', 'slow.typing@email.com')
cy.get('.action-disabled')
// Ignore error checking prior to type
// like whether the input is visible or disabled
.type('disabled error checking', { force: true })
.should('have.value', 'disabled error checking')
})
it('.focus() - focus on a DOM element', () => {
// https://on.cypress.io/focus
cy.get('.action-focus').focus()
.should('have.class', 'focus')
.prev().should('have.attr', 'style', 'color: orange;')
})
it('.blur() - blur off a DOM element', () => {
// https://on.cypress.io/blur
cy.get('.action-blur').type('About to blur').blur()
.should('have.class', 'error')
.prev().should('have.attr', 'style', 'color: red;')
})
it('.clear() - clears an input or textarea element', () => {
// https://on.cypress.io/clear
cy.get('.action-clear').type('Clear this text')
.should('have.value', 'Clear this text')
.clear()
.should('have.value', '')
})
it('.submit() - submit a form', () => {
// https://on.cypress.io/submit
cy.get('.action-form')
.find('[type="text"]').type('HALFOFF')
cy.get('.action-form').submit()
.next().should('contain', 'Your form has been submitted!')
})
it('.click() - click on a DOM element', () => {
// https://on.cypress.io/click
cy.get('.action-btn').click()
// You can click on 9 specific positions of an element:
// -----------------------------------
// | topLeft top topRight |
// | |
// | |
// | |
// | left center right |
// | |
// | |
// | |
// | bottomLeft bottom bottomRight |
// -----------------------------------
// clicking in the center of the element is the default
cy.get('#action-canvas').click()
cy.get('#action-canvas').click('topLeft')
cy.get('#action-canvas').click('top')
cy.get('#action-canvas').click('topRight')
cy.get('#action-canvas').click('left')
cy.get('#action-canvas').click('right')
cy.get('#action-canvas').click('bottomLeft')
cy.get('#action-canvas').click('bottom')
cy.get('#action-canvas').click('bottomRight')
// .click() accepts an x and y coordinate
// that controls where the click occurs :)
cy.get('#action-canvas')
.click(80, 75) // click 80px on x coord and 75px on y coord
.click(170, 75)
.click(80, 165)
.click(100, 185)
.click(125, 190)
.click(150, 185)
.click(170, 165)
// click multiple elements by passing multiple: true
cy.get('.action-labels>.label').click({ multiple: true })
// Ignore error checking prior to clicking
cy.get('.action-opacity>.btn').click({ force: true })
})
it('.dblclick() - double click on a DOM element', () => {
// https://on.cypress.io/dblclick
// Our app has a listener on 'dblclick' event in our 'scripts.js'
// that hides the div and shows an input on double click
cy.get('.action-div').dblclick().should('not.be.visible')
cy.get('.action-input-hidden').should('be.visible')
})
it('.rightclick() - right click on a DOM element', () => {
// https://on.cypress.io/rightclick
// Our app has a listener on 'contextmenu' event in our 'scripts.js'
// that hides the div and shows an input on right click
cy.get('.rightclick-action-div').rightclick().should('not.be.visible')
cy.get('.rightclick-action-input-hidden').should('be.visible')
})
it('.check() - check a checkbox or radio element', () => {
// https://on.cypress.io/check
// By default, .check() will check all
// matching checkbox or radio elements in succession, one after another
cy.get('.action-checkboxes [type="checkbox"]').not('[disabled]')
.check().should('be.checked')
cy.get('.action-radios [type="radio"]').not('[disabled]')
.check().should('be.checked')
// .check() accepts a value argument
cy.get('.action-radios [type="radio"]')
.check('radio1').should('be.checked')
// .check() accepts an array of values
cy.get('.action-multiple-checkboxes [type="checkbox"]')
.check(['checkbox1', 'checkbox2']).should('be.checked')
// Ignore error checking prior to checking
cy.get('.action-checkboxes [disabled]')
.check({ force: true }).should('be.checked')
cy.get('.action-radios [type="radio"]')
.check('radio3', { force: true }).should('be.checked')
})
it('.uncheck() - uncheck a checkbox element', () => {
// https://on.cypress.io/uncheck
// By default, .uncheck() will uncheck all matching
// checkbox elements in succession, one after another
cy.get('.action-check [type="checkbox"]')
.not('[disabled]')
.uncheck().should('not.be.checked')
// .uncheck() accepts a value argument
cy.get('.action-check [type="checkbox"]')
.check('checkbox1')
.uncheck('checkbox1').should('not.be.checked')
// .uncheck() accepts an array of values
cy.get('.action-check [type="checkbox"]')
.check(['checkbox1', 'checkbox3'])
.uncheck(['checkbox1', 'checkbox3']).should('not.be.checked')
// Ignore error checking prior to unchecking
cy.get('.action-check [disabled]')
.uncheck({ force: true }).should('not.be.checked')
})
it('.select() - select an option in a <select> element', () => {
// https://on.cypress.io/select
// at first, no option should be selected
cy.get('.action-select')
.should('have.value', '--Select a fruit--')
// Select option(s) with matching text content
cy.get('.action-select').select('apples')
// confirm the apples were selected
// note that each value starts with "fr-" in our HTML
cy.get('.action-select').should('have.value', 'fr-apples')
cy.get('.action-select-multiple')
.select(['apples', 'oranges', 'bananas'])
// when getting multiple values, invoke "val" method first
.invoke('val')
.should('deep.equal', ['fr-apples', 'fr-oranges', 'fr-bananas'])
// Select option(s) with matching value
cy.get('.action-select').select('fr-bananas')
// can attach an assertion right away to the element
.should('have.value', 'fr-bananas')
cy.get('.action-select-multiple')
.select(['fr-apples', 'fr-oranges', 'fr-bananas'])
.invoke('val')
.should('deep.equal', ['fr-apples', 'fr-oranges', 'fr-bananas'])
// assert the selected values include oranges
cy.get('.action-select-multiple')
.invoke('val').should('include', 'fr-oranges')
})
it('.scrollIntoView() - scroll an element into view', () => {
// https://on.cypress.io/scrollintoview
// normally all of these buttons are hidden,
// because they're not within
// the viewable area of their parent
// (we need to scroll to see them)
cy.get('#scroll-horizontal button')
.should('not.be.visible')
// scroll the button into view, as if the user had scrolled
cy.get('#scroll-horizontal button').scrollIntoView()
.should('be.visible')
cy.get('#scroll-vertical button')
.should('not.be.visible')
// Cypress handles the scroll direction needed
cy.get('#scroll-vertical button').scrollIntoView()
.should('be.visible')
cy.get('#scroll-both button')
.should('not.be.visible')
// Cypress knows to scroll to the right and down
cy.get('#scroll-both button').scrollIntoView()
.should('be.visible')
})
it('.trigger() - trigger an event on a DOM element', () => {
// https://on.cypress.io/trigger
// To interact with a range input (slider)
// we need to set its value & trigger the
// event to signal it changed
// Here, we invoke jQuery's val() method to set
// the value and trigger the 'change' event
cy.get('.trigger-input-range')
.invoke('val', 25)
.trigger('change')
.get('input[type=range]').siblings('p')
.should('have.text', '25')
})
it('cy.scrollTo() - scroll the window or element to a position', () => {
// https://on.cypress.io/scrollto
// You can scroll to 9 specific positions of an element:
// -----------------------------------
// | topLeft top topRight |
// | |
// | |
// | |
// | left center right |
// | |
// | |
// | |
// | bottomLeft bottom bottomRight |
// -----------------------------------
// if you chain .scrollTo() off of cy, we will
// scroll the entire window
cy.scrollTo('bottom')
cy.get('#scrollable-horizontal').scrollTo('right')
// or you can scroll to a specific coordinate:
// (x axis, y axis) in pixels
cy.get('#scrollable-vertical').scrollTo(250, 250)
// or you can scroll to a specific percentage
// of the (width, height) of the element
cy.get('#scrollable-both').scrollTo('75%', '25%')
// control the easing of the scroll (default is 'swing')
cy.get('#scrollable-vertical').scrollTo('center', { easing: 'linear' })
// control the duration of the scroll (in ms)
cy.get('#scrollable-both').scrollTo('center', { duration: 2000 })
})
})

@ -0,0 +1,39 @@
/// <reference types="cypress" />
context('Aliasing', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/aliasing')
})
it('.as() - alias a DOM element for later use', () => {
// https://on.cypress.io/as
// Alias a DOM element for use later
// We don't have to traverse to the element
// later in our code, we reference it with @
cy.get('.as-table').find('tbody>tr')
.first().find('td').first()
.find('button').as('firstBtn')
// when we reference the alias, we place an
// @ in front of its name
cy.get('@firstBtn').click()
cy.get('@firstBtn')
.should('have.class', 'btn-success')
.and('contain', 'Changed')
})
it('.as() - alias a route for later use', () => {
// Alias the route to wait for its response
cy.intercept('GET', '**/comments/*').as('getComment')
// we have code that gets a comment when
// the button is clicked in scripts.js
cy.get('.network-btn').click()
// https://on.cypress.io/wait
cy.wait('@getComment').its('response.statusCode').should('eq', 200)
})
})

@ -0,0 +1,177 @@
/// <reference types="cypress" />
context('Assertions', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/assertions')
})
describe('Implicit Assertions', () => {
it('.should() - make an assertion about the current subject', () => {
// https://on.cypress.io/should
cy.get('.assertion-table')
.find('tbody tr:last')
.should('have.class', 'success')
.find('td')
.first()
// checking the text of the <td> element in various ways
.should('have.text', 'Column content')
.should('contain', 'Column content')
.should('have.html', 'Column content')
// chai-jquery uses "is()" to check if element matches selector
.should('match', 'td')
// to match text content against a regular expression
// first need to invoke jQuery method text()
// and then match using regular expression
.invoke('text')
.should('match', /column content/i)
// a better way to check element's text content against a regular expression
// is to use "cy.contains"
// https://on.cypress.io/contains
cy.get('.assertion-table')
.find('tbody tr:last')
// finds first <td> element with text content matching regular expression
.contains('td', /column content/i)
.should('be.visible')
// for more information about asserting element's text
// see https://on.cypress.io/using-cypress-faq#How-do-I-get-an-elements-text-contents
})
it('.and() - chain multiple assertions together', () => {
// https://on.cypress.io/and
cy.get('.assertions-link')
.should('have.class', 'active')
.and('have.attr', 'href')
.and('include', 'cypress.io')
})
})
describe('Explicit Assertions', () => {
// https://on.cypress.io/assertions
it('expect - make an assertion about a specified subject', () => {
// We can use Chai's BDD style assertions
expect(true).to.be.true
const o = { foo: 'bar' }
expect(o).to.equal(o)
expect(o).to.deep.equal({ foo: 'bar' })
// matching text using regular expression
expect('FooBar').to.match(/bar$/i)
})
it('pass your own callback function to should()', () => {
// Pass a function to should that can have any number
// of explicit assertions within it.
// The ".should(cb)" function will be retried
// automatically until it passes all your explicit assertions or times out.
cy.get('.assertions-p')
.find('p')
.should(($p) => {
// https://on.cypress.io/$
// return an array of texts from all of the p's
// @ts-ignore TS6133 unused variable
const texts = $p.map((i, el) => Cypress.$(el).text())
// jquery map returns jquery object
// and .get() convert this to simple array
const paragraphs = texts.get()
// array should have length of 3
expect(paragraphs, 'has 3 paragraphs').to.have.length(3)
// use second argument to expect(...) to provide clear
// message with each assertion
expect(paragraphs, 'has expected text in each paragraph').to.deep.eq([
'Some text from first p',
'More text from second p',
'And even more text from third p',
])
})
})
it('finds element by class name regex', () => {
cy.get('.docs-header')
.find('div')
// .should(cb) callback function will be retried
.should(($div) => {
expect($div).to.have.length(1)
const className = $div[0].className
expect(className).to.match(/heading-/)
})
// .then(cb) callback is not retried,
// it either passes or fails
.then(($div) => {
expect($div, 'text content').to.have.text('Introduction')
})
})
it('can throw any error', () => {
cy.get('.docs-header')
.find('div')
.should(($div) => {
if ($div.length !== 1) {
// you can throw your own errors
throw new Error('Did not find 1 element')
}
const className = $div[0].className
if (!className.match(/heading-/)) {
throw new Error(`Could not find class "heading-" in ${className}`)
}
})
})
it('matches unknown text between two elements', () => {
/**
* Text from the first element.
* @type {string}
*/
let text
/**
* Normalizes passed text,
* useful before comparing text with spaces and different capitalization.
* @param {string} s Text to normalize
*/
const normalizeText = (s) => s.replace(/\s/g, '').toLowerCase()
cy.get('.two-elements')
.find('.first')
.then(($first) => {
// save text from the first element
text = normalizeText($first.text())
})
cy.get('.two-elements')
.find('.second')
.should(($div) => {
// we can massage text before comparing
const secondText = normalizeText($div.text())
expect(secondText, 'second text').to.equal(text)
})
})
it('assert - assert shape of an object', () => {
const person = {
name: 'Joe',
age: 20,
}
assert.isObject(person, 'value is object')
})
it('retries the should callback until assertions pass', () => {
cy.get('#random-number')
.should(($div) => {
const n = parseFloat($div.text())
expect(n).to.be.gte(1).and.be.lte(10)
})
})
})
})

@ -0,0 +1,97 @@
/// <reference types="cypress" />
context('Connectors', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/connectors')
})
it('.each() - iterate over an array of elements', () => {
// https://on.cypress.io/each
cy.get('.connectors-each-ul>li')
.each(($el, index, $list) => {
console.log($el, index, $list)
})
})
it('.its() - get properties on the current subject', () => {
// https://on.cypress.io/its
cy.get('.connectors-its-ul>li')
// calls the 'length' property yielding that value
.its('length')
.should('be.gt', 2)
})
it('.invoke() - invoke a function on the current subject', () => {
// our div is hidden in our script.js
// $('.connectors-div').hide()
// https://on.cypress.io/invoke
cy.get('.connectors-div').should('be.hidden')
// call the jquery method 'show' on the 'div.container'
.invoke('show')
.should('be.visible')
})
it('.spread() - spread an array as individual args to callback function', () => {
// https://on.cypress.io/spread
const arr = ['foo', 'bar', 'baz']
cy.wrap(arr).spread((foo, bar, baz) => {
expect(foo).to.eq('foo')
expect(bar).to.eq('bar')
expect(baz).to.eq('baz')
})
})
describe('.then()', () => {
it('invokes a callback function with the current subject', () => {
// https://on.cypress.io/then
cy.get('.connectors-list > li')
.then(($lis) => {
expect($lis, '3 items').to.have.length(3)
expect($lis.eq(0), 'first item').to.contain('Walk the dog')
expect($lis.eq(1), 'second item').to.contain('Feed the cat')
expect($lis.eq(2), 'third item').to.contain('Write JavaScript')
})
})
it('yields the returned value to the next command', () => {
cy.wrap(1)
.then((num) => {
expect(num).to.equal(1)
return 2
})
.then((num) => {
expect(num).to.equal(2)
})
})
it('yields the original subject without return', () => {
cy.wrap(1)
.then((num) => {
expect(num).to.equal(1)
// note that nothing is returned from this callback
})
.then((num) => {
// this callback receives the original unchanged value 1
expect(num).to.equal(1)
})
})
it('yields the value yielded by the last Cypress command inside', () => {
cy.wrap(1)
.then((num) => {
expect(num).to.equal(1)
// note how we run a Cypress command
// the result yielded by this Cypress command
// will be passed to the second ".then"
cy.wrap(2)
})
.then((num) => {
// this callback receives the value yielded by "cy.wrap(2)"
expect(num).to.equal(2)
})
})
})
})

@ -0,0 +1,77 @@
/// <reference types="cypress" />
context('Cookies', () => {
beforeEach(() => {
Cypress.Cookies.debug(true)
cy.visit('https://example.cypress.io/commands/cookies')
// clear cookies again after visiting to remove
// any 3rd party cookies picked up such as cloudflare
cy.clearCookies()
})
it('cy.getCookie() - get a browser cookie', () => {
// https://on.cypress.io/getcookie
cy.get('#getCookie .set-a-cookie').click()
// cy.getCookie() yields a cookie object
cy.getCookie('token').should('have.property', 'value', '123ABC')
})
it('cy.getCookies() - get browser cookies', () => {
// https://on.cypress.io/getcookies
cy.getCookies().should('be.empty')
cy.get('#getCookies .set-a-cookie').click()
// cy.getCookies() yields an array of cookies
cy.getCookies().should('have.length', 1).should((cookies) => {
// each cookie has these properties
expect(cookies[0]).to.have.property('name', 'token')
expect(cookies[0]).to.have.property('value', '123ABC')
expect(cookies[0]).to.have.property('httpOnly', false)
expect(cookies[0]).to.have.property('secure', false)
expect(cookies[0]).to.have.property('domain')
expect(cookies[0]).to.have.property('path')
})
})
it('cy.setCookie() - set a browser cookie', () => {
// https://on.cypress.io/setcookie
cy.getCookies().should('be.empty')
cy.setCookie('foo', 'bar')
// cy.getCookie() yields a cookie object
cy.getCookie('foo').should('have.property', 'value', 'bar')
})
it('cy.clearCookie() - clear a browser cookie', () => {
// https://on.cypress.io/clearcookie
cy.getCookie('token').should('be.null')
cy.get('#clearCookie .set-a-cookie').click()
cy.getCookie('token').should('have.property', 'value', '123ABC')
// cy.clearCookies() yields null
cy.clearCookie('token').should('be.null')
cy.getCookie('token').should('be.null')
})
it('cy.clearCookies() - clear browser cookies', () => {
// https://on.cypress.io/clearcookies
cy.getCookies().should('be.empty')
cy.get('#clearCookies .set-a-cookie').click()
cy.getCookies().should('have.length', 1)
// cy.clearCookies() yields null
cy.clearCookies()
cy.getCookies().should('be.empty')
})
})

@ -0,0 +1,202 @@
/// <reference types="cypress" />
context('Cypress.Commands', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
// https://on.cypress.io/custom-commands
it('.add() - create a custom command', () => {
Cypress.Commands.add('console', {
prevSubject: true,
}, (subject, method) => {
// the previous subject is automatically received
// and the commands arguments are shifted
// allow us to change the console method used
method = method || 'log'
// log the subject to the console
// @ts-ignore TS7017
console[method]('The subject is', subject)
// whatever we return becomes the new subject
// we don't want to change the subject so
// we return whatever was passed in
return subject
})
// @ts-ignore TS2339
cy.get('button').console('info').then(($button) => {
// subject is still $button
})
})
})
context('Cypress.Cookies', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
// https://on.cypress.io/cookies
it('.debug() - enable or disable debugging', () => {
Cypress.Cookies.debug(true)
// Cypress will now log in the console when
// cookies are set or cleared
cy.setCookie('fakeCookie', '123ABC')
cy.clearCookie('fakeCookie')
cy.setCookie('fakeCookie', '123ABC')
cy.clearCookie('fakeCookie')
cy.setCookie('fakeCookie', '123ABC')
})
it('.preserveOnce() - preserve cookies by key', () => {
// normally cookies are reset after each test
cy.getCookie('fakeCookie').should('not.be.ok')
// preserving a cookie will not clear it when
// the next test starts
cy.setCookie('lastCookie', '789XYZ')
Cypress.Cookies.preserveOnce('lastCookie')
})
it('.defaults() - set defaults for all cookies', () => {
// now any cookie with the name 'session_id' will
// not be cleared before each new test runs
Cypress.Cookies.defaults({
preserve: 'session_id',
})
})
})
context('Cypress.arch', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
it('Get CPU architecture name of underlying OS', () => {
// https://on.cypress.io/arch
expect(Cypress.arch).to.exist
})
})
context('Cypress.config()', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
it('Get and set configuration options', () => {
// https://on.cypress.io/config
let myConfig = Cypress.config()
expect(myConfig).to.have.property('animationDistanceThreshold', 5)
expect(myConfig).to.have.property('baseUrl', null)
expect(myConfig).to.have.property('defaultCommandTimeout', 4000)
expect(myConfig).to.have.property('requestTimeout', 5000)
expect(myConfig).to.have.property('responseTimeout', 30000)
expect(myConfig).to.have.property('viewportHeight', 660)
expect(myConfig).to.have.property('viewportWidth', 1000)
expect(myConfig).to.have.property('pageLoadTimeout', 60000)
expect(myConfig).to.have.property('waitForAnimations', true)
expect(Cypress.config('pageLoadTimeout')).to.eq(60000)
// this will change the config for the rest of your tests!
Cypress.config('pageLoadTimeout', 20000)
expect(Cypress.config('pageLoadTimeout')).to.eq(20000)
Cypress.config('pageLoadTimeout', 60000)
})
})
context('Cypress.dom', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
// https://on.cypress.io/dom
it('.isHidden() - determine if a DOM element is hidden', () => {
let hiddenP = Cypress.$('.dom-p p.hidden').get(0)
let visibleP = Cypress.$('.dom-p p.visible').get(0)
// our first paragraph has css class 'hidden'
expect(Cypress.dom.isHidden(hiddenP)).to.be.true
expect(Cypress.dom.isHidden(visibleP)).to.be.false
})
})
context('Cypress.env()', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
// We can set environment variables for highly dynamic values
// https://on.cypress.io/environment-variables
it('Get environment variables', () => {
// https://on.cypress.io/env
// set multiple environment variables
Cypress.env({
host: 'veronica.dev.local',
api_server: 'http://localhost:8888/v1/',
})
// get environment variable
expect(Cypress.env('host')).to.eq('veronica.dev.local')
// set environment variable
Cypress.env('api_server', 'http://localhost:8888/v2/')
expect(Cypress.env('api_server')).to.eq('http://localhost:8888/v2/')
// get all environment variable
expect(Cypress.env()).to.have.property('host', 'veronica.dev.local')
expect(Cypress.env()).to.have.property('api_server', 'http://localhost:8888/v2/')
})
})
context('Cypress.log', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
it('Control what is printed to the Command Log', () => {
// https://on.cypress.io/cypress-log
})
})
context('Cypress.platform', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
it('Get underlying OS name', () => {
// https://on.cypress.io/platform
expect(Cypress.platform).to.be.exist
})
})
context('Cypress.version', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
it('Get current version of Cypress being run', () => {
// https://on.cypress.io/version
expect(Cypress.version).to.be.exist
})
})
context('Cypress.spec', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/cypress-api')
})
it('Get current spec information', () => {
// https://on.cypress.io/spec
// wrap the object so we can inspect it easily by clicking in the command log
cy.wrap(Cypress.spec).should('include.keys', ['name', 'relative', 'absolute'])
})
})

@ -0,0 +1,89 @@
/// <reference types="cypress" />
/// JSON fixture file can be loaded directly using
// the built-in JavaScript bundler
// @ts-ignore
const requiredExample = require('../../fixtures/example')
context('Files', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/files')
})
beforeEach(() => {
// load example.json fixture file and store
// in the test context object
cy.fixture('example.json').as('example')
})
it('cy.fixture() - load a fixture', () => {
// https://on.cypress.io/fixture
// Instead of writing a response inline you can
// use a fixture file's content.
// when application makes an Ajax request matching "GET **/comments/*"
// Cypress will intercept it and reply with the object in `example.json` fixture
cy.intercept('GET', '**/comments/*', { fixture: 'example.json' }).as('getComment')
// we have code that gets a comment when
// the button is clicked in scripts.js
cy.get('.fixture-btn').click()
cy.wait('@getComment').its('response.body')
.should('have.property', 'name')
.and('include', 'Using fixtures to represent data')
})
it('cy.fixture() or require - load a fixture', function () {
// we are inside the "function () { ... }"
// callback and can use test context object "this"
// "this.example" was loaded in "beforeEach" function callback
expect(this.example, 'fixture in the test context')
.to.deep.equal(requiredExample)
// or use "cy.wrap" and "should('deep.equal', ...)" assertion
// @ts-ignore
cy.wrap(this.example, 'fixture vs require')
.should('deep.equal', requiredExample)
})
it('cy.readFile() - read file contents', () => {
// https://on.cypress.io/readfile
// You can read a file and yield its contents
// The filePath is relative to your project's root.
cy.readFile('cypress.json').then((json) => {
expect(json).to.be.an('object')
})
})
it('cy.writeFile() - write to a file', () => {
// https://on.cypress.io/writefile
// You can write to a file
// Use a response from a request to automatically
// generate a fixture file for use later
cy.request('https://jsonplaceholder.cypress.io/users')
.then((response) => {
cy.writeFile('cypress/fixtures/users.json', response.body)
})
cy.fixture('users').should((users) => {
expect(users[0].name).to.exist
})
// JavaScript arrays and objects are stringified
// and formatted into text.
cy.writeFile('cypress/fixtures/profile.json', {
id: 8739,
name: 'Jane',
email: 'jane@example.com',
})
cy.fixture('profile').should((profile) => {
expect(profile.name).to.eq('Jane')
})
})
})

@ -0,0 +1,52 @@
/// <reference types="cypress" />
context('Local Storage', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/local-storage')
})
// Although local storage is automatically cleared
// in between tests to maintain a clean state
// sometimes we need to clear the local storage manually
it('cy.clearLocalStorage() - clear all data in local storage', () => {
// https://on.cypress.io/clearlocalstorage
cy.get('.ls-btn').click().should(() => {
expect(localStorage.getItem('prop1')).to.eq('red')
expect(localStorage.getItem('prop2')).to.eq('blue')
expect(localStorage.getItem('prop3')).to.eq('magenta')
})
// clearLocalStorage() yields the localStorage object
cy.clearLocalStorage().should((ls) => {
expect(ls.getItem('prop1')).to.be.null
expect(ls.getItem('prop2')).to.be.null
expect(ls.getItem('prop3')).to.be.null
})
// Clear key matching string in Local Storage
cy.get('.ls-btn').click().should(() => {
expect(localStorage.getItem('prop1')).to.eq('red')
expect(localStorage.getItem('prop2')).to.eq('blue')
expect(localStorage.getItem('prop3')).to.eq('magenta')
})
cy.clearLocalStorage('prop1').should((ls) => {
expect(ls.getItem('prop1')).to.be.null
expect(ls.getItem('prop2')).to.eq('blue')
expect(ls.getItem('prop3')).to.eq('magenta')
})
// Clear keys matching regex in Local Storage
cy.get('.ls-btn').click().should(() => {
expect(localStorage.getItem('prop1')).to.eq('red')
expect(localStorage.getItem('prop2')).to.eq('blue')
expect(localStorage.getItem('prop3')).to.eq('magenta')
})
cy.clearLocalStorage(/prop1|2/).should((ls) => {
expect(ls.getItem('prop1')).to.be.null
expect(ls.getItem('prop2')).to.be.null
expect(ls.getItem('prop3')).to.eq('magenta')
})
})
})

@ -0,0 +1,32 @@
/// <reference types="cypress" />
context('Location', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/location')
})
it('cy.hash() - get the current URL hash', () => {
// https://on.cypress.io/hash
cy.hash().should('be.empty')
})
it('cy.location() - get window.location', () => {
// https://on.cypress.io/location
cy.location().should((location) => {
expect(location.hash).to.be.empty
expect(location.href).to.eq('https://example.cypress.io/commands/location')
expect(location.host).to.eq('example.cypress.io')
expect(location.hostname).to.eq('example.cypress.io')
expect(location.origin).to.eq('https://example.cypress.io')
expect(location.pathname).to.eq('/commands/location')
expect(location.port).to.eq('')
expect(location.protocol).to.eq('https:')
expect(location.search).to.be.empty
})
})
it('cy.url() - get the current URL', () => {
// https://on.cypress.io/url
cy.url().should('eq', 'https://example.cypress.io/commands/location')
})
})

@ -0,0 +1,104 @@
/// <reference types="cypress" />
context('Misc', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/misc')
})
it('.end() - end the command chain', () => {
// https://on.cypress.io/end
// cy.end is useful when you want to end a chain of commands
// and force Cypress to re-query from the root element
cy.get('.misc-table').within(() => {
// ends the current chain and yields null
cy.contains('Cheryl').click().end()
// queries the entire table again
cy.contains('Charles').click()
})
})
it('cy.exec() - execute a system command', () => {
// execute a system command.
// so you can take actions necessary for
// your test outside the scope of Cypress.
// https://on.cypress.io/exec
// we can use Cypress.platform string to
// select appropriate command
// https://on.cypress/io/platform
cy.log(`Platform ${Cypress.platform} architecture ${Cypress.arch}`)
// on CircleCI Windows build machines we have a failure to run bash shell
// https://github.com/cypress-io/cypress/issues/5169
// so skip some of the tests by passing flag "--env circle=true"
const isCircleOnWindows = Cypress.platform === 'win32' && Cypress.env('circle')
if (isCircleOnWindows) {
cy.log('Skipping test on CircleCI')
return
}
// cy.exec problem on Shippable CI
// https://github.com/cypress-io/cypress/issues/6718
const isShippable = Cypress.platform === 'linux' && Cypress.env('shippable')
if (isShippable) {
cy.log('Skipping test on ShippableCI')
return
}
cy.exec('echo Jane Lane')
.its('stdout').should('contain', 'Jane Lane')
if (Cypress.platform === 'win32') {
cy.exec('print cypress.json')
.its('stderr').should('be.empty')
} else {
cy.exec('cat cypress.json')
.its('stderr').should('be.empty')
cy.exec('pwd')
.its('code').should('eq', 0)
}
})
it('cy.focused() - get the DOM element that has focus', () => {
// https://on.cypress.io/focused
cy.get('.misc-form').find('#name').click()
cy.focused().should('have.id', 'name')
cy.get('.misc-form').find('#description').click()
cy.focused().should('have.id', 'description')
})
context('Cypress.Screenshot', function () {
it('cy.screenshot() - take a screenshot', () => {
// https://on.cypress.io/screenshot
cy.screenshot('my-image')
})
it('Cypress.Screenshot.defaults() - change default config of screenshots', function () {
Cypress.Screenshot.defaults({
blackout: ['.foo'],
capture: 'viewport',
clip: { x: 0, y: 0, width: 200, height: 200 },
scale: false,
disableTimersAndAnimations: true,
screenshotOnRunFailure: true,
onBeforeScreenshot () { },
onAfterScreenshot () { },
})
})
})
it('cy.wrap() - wrap an object', () => {
// https://on.cypress.io/wrap
cy.wrap({ foo: 'bar' })
.should('have.property', 'foo')
.and('include', 'bar')
})
})

@ -0,0 +1,56 @@
/// <reference types="cypress" />
context('Navigation', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io')
cy.get('.navbar-nav').contains('Commands').click()
cy.get('.dropdown-menu').contains('Navigation').click()
})
it('cy.go() - go back or forward in the browser\'s history', () => {
// https://on.cypress.io/go
cy.location('pathname').should('include', 'navigation')
cy.go('back')
cy.location('pathname').should('not.include', 'navigation')
cy.go('forward')
cy.location('pathname').should('include', 'navigation')
// clicking back
cy.go(-1)
cy.location('pathname').should('not.include', 'navigation')
// clicking forward
cy.go(1)
cy.location('pathname').should('include', 'navigation')
})
it('cy.reload() - reload the page', () => {
// https://on.cypress.io/reload
cy.reload()
// reload the page without using the cache
cy.reload(true)
})
it('cy.visit() - visit a remote url', () => {
// https://on.cypress.io/visit
// Visit any sub-domain of your current domain
// Pass options to the visit
cy.visit('https://example.cypress.io/commands/navigation', {
timeout: 50000, // increase total time for the visit to resolve
onBeforeLoad (contentWindow) {
// contentWindow is the remote page's window object
expect(typeof contentWindow === 'object').to.be.true
},
onLoad (contentWindow) {
// contentWindow is the remote page's window object
expect(typeof contentWindow === 'object').to.be.true
},
})
})
})

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save