mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-13 00:32:57 -07:00
Merge
This commit is contained in:
commit
9f575d1e64
14 changed files with 45 additions and 2517 deletions
|
@ -165,10 +165,11 @@ namespace Ombi.Core.Models.Requests
|
||||||
|
|
||||||
public async Task<IEnumerable<T>> GetAllAsync(int count, int position)
|
public async Task<IEnumerable<T>> GetAllAsync(int count, int position)
|
||||||
{
|
{
|
||||||
var blobs = await Repo.GetAllAsync(count, position).ConfigureAwait(false);
|
var blobs = await Repo.GetAllAsync().ConfigureAwait(false);
|
||||||
|
|
||||||
var retVal = new List<T>();
|
var retVal = new List<T>();
|
||||||
|
|
||||||
foreach (var b in blobs.Where(x => x.Type == RequestType))
|
foreach (var b in blobs.Where(x => x.Type == RequestType).Skip(position).Take(count))
|
||||||
{
|
{
|
||||||
if (b == null)
|
if (b == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
11
src/Ombi.Helpers/CacheKeys.cs
Normal file
11
src/Ombi.Helpers/CacheKeys.cs
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Ombi.Helpers
|
||||||
|
{
|
||||||
|
public static class CacheKeys
|
||||||
|
{
|
||||||
|
public const string RadarrCacher = nameof(RadarrCacher);
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,5 +6,6 @@ namespace Ombi.Helpers
|
||||||
{
|
{
|
||||||
public static EventId ApiException => new EventId(1000);
|
public static EventId ApiException => new EventId(1000);
|
||||||
public static EventId CacherException => new EventId(2000);
|
public static EventId CacherException => new EventId(2000);
|
||||||
|
public static EventId RadarrCacherException => new EventId(2001);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -12,7 +12,6 @@ namespace Ombi.Store.Repository
|
||||||
RequestBlobs Get(int id);
|
RequestBlobs Get(int id);
|
||||||
IEnumerable<RequestBlobs> GetAll();
|
IEnumerable<RequestBlobs> GetAll();
|
||||||
Task<IEnumerable<RequestBlobs>> GetAllAsync();
|
Task<IEnumerable<RequestBlobs>> GetAllAsync();
|
||||||
Task<IEnumerable<RequestBlobs>> GetAllAsync(int count, int position);
|
|
||||||
Task<RequestBlobs> GetAsync(int id);
|
Task<RequestBlobs> GetAsync(int id);
|
||||||
RequestBlobs Insert(RequestBlobs entity);
|
RequestBlobs Insert(RequestBlobs entity);
|
||||||
Task<RequestBlobs> InsertAsync(RequestBlobs entity);
|
Task<RequestBlobs> InsertAsync(RequestBlobs entity);
|
||||||
|
|
|
@ -62,18 +62,6 @@ namespace Ombi.Store.Repository
|
||||||
//}, 5);
|
//}, 5);
|
||||||
//return item;
|
//return item;
|
||||||
}
|
}
|
||||||
public async Task<IEnumerable<RequestBlobs>> GetAllAsync(int count, int position)
|
|
||||||
{
|
|
||||||
//var key = "GetAll";
|
|
||||||
//var item = await Cache.GetOrSetAsync(key, async () =>
|
|
||||||
//{
|
|
||||||
|
|
||||||
var page = await Db.Requests.ToListAsync().ConfigureAwait(false);
|
|
||||||
return page.Skip(position).Take(count);
|
|
||||||
|
|
||||||
//}, 5);
|
|
||||||
//return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
public RequestBlobs Get(int id)
|
public RequestBlobs Get(int id)
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,6 +60,7 @@ namespace Ombi
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
// Add framework services.
|
// Add framework services.
|
||||||
|
services.AddMemoryCache();
|
||||||
services.AddMvc();
|
services.AddMvc();
|
||||||
services.AddOmbiMappingProfile();
|
services.AddOmbiMappingProfile();
|
||||||
services.AddAutoMapper(expression =>
|
services.AddAutoMapper(expression =>
|
||||||
|
|
|
@ -58,6 +58,8 @@ var paths = {
|
||||||
'./node_modules/bootstrap/dist/js/bootstrap.js',
|
'./node_modules/bootstrap/dist/js/bootstrap.js',
|
||||||
'./node_modules/tether/dist/js/tether.js',
|
'./node_modules/tether/dist/js/tether.js',
|
||||||
'./node_modules/angular2-jwt/angular2-jwt.js',
|
'./node_modules/angular2-jwt/angular2-jwt.js',
|
||||||
|
'./node_modules/dragula/dist/dragula.js'
|
||||||
|
|
||||||
|
|
||||||
],
|
],
|
||||||
dest: './lib/'
|
dest: './lib/'
|
||||||
|
@ -75,7 +77,7 @@ var paths = {
|
||||||
'./node_modules/primeng/resources/primeng.css',
|
'./node_modules/primeng/resources/primeng.css',
|
||||||
'./node_modules/tether/dist/css/tether.css',
|
'./node_modules/tether/dist/css/tether.css',
|
||||||
'./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css',
|
'./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css',
|
||||||
'./node_modules/dragula/dist/dragula.css'
|
'./node_modules/dragula/dist/dragula.js'
|
||||||
],
|
],
|
||||||
dest: './css/lib/'
|
dest: './css/lib/'
|
||||||
},
|
},
|
||||||
|
|
2474
src/Ombi/package-lock.json
generated
2474
src/Ombi/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -1,3 +1,3 @@
|
||||||
<div *ngIf="request">
|
<div *ngIf="request" style="background-color:black; color:white;">
|
||||||
{{request.title}}
|
{{request.title}}
|
||||||
</div>
|
</div>
|
|
@ -1,39 +1,50 @@
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.landing-box {
|
||||||
|
height: 150px;
|
||||||
|
background: #333333 !important;
|
||||||
|
border-radius: 2%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
text-align: center;
|
||||||
|
box-shadow: 5px 3px 5px black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<div *ngIf="tvRequests">
|
<div *ngIf="tvRequests">
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<md-card>
|
<div class="landing-box">
|
||||||
<md-card-title>Title</md-card-title>
|
<md-card-title>Title</md-card-title>
|
||||||
<div [dragula]='"requests"' [dragulaModel]="tvRequests.new">
|
<div [dragula]='"requests-bag"' [dragulaModel]="tvRequests.new">
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<request-card *ngFor="let item of tvRequests.new" [request]="item" [attr.data.id]="item.id"></request-card>
|
<request-card *ngFor="let item of tvRequests.new" [request]="item" ></request-card>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</md-card>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<md-card>
|
<div class="landing-box">
|
||||||
<md-card-title>Title</md-card-title>
|
|
||||||
<div [dragula]='"requests"' [dragulaModel]="tvRequests.approved">
|
<div [dragula]='"requests-bag"' [dragulaModel]="tvRequests.approved">
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<request-card *ngFor="let item of tvRequests.approved" [request]="item" [attr.data.id]="item.id"></request-card>
|
<request-card *ngFor="let item of tvRequests.approved" [request]="item"></request-card>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</md-card>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<md-card>
|
<div class="landing-box">
|
||||||
<md-card-title>Title</md-card-title>
|
<md-card-title>Title</md-card-title>
|
||||||
<div style="border: dashed">
|
<div style="border: dashed">
|
||||||
<div [dragula]='"requests"' [dragulaModel]="tvRequests.available">
|
<div [dragula]='"requests-bag"' [dragulaModel]="tvRequests.available">
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<request-card *ngFor="let item of tvRequests.available" [request]="item" [attr.data.id]="item.id"></request-card>
|
<request-card *ngFor="let item of tvRequests.available" [request]="item"></request-card>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</md-card>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -10,13 +10,7 @@ import { ITvRequestModel, IMovieRequestModel, IRequestGrid } from '../interfaces
|
||||||
export class RequestGridComponent implements OnInit {
|
export class RequestGridComponent implements OnInit {
|
||||||
|
|
||||||
constructor(private dragulaService: DragulaService, private requestService: RequestService) {
|
constructor(private dragulaService: DragulaService, private requestService: RequestService) {
|
||||||
this.dragulaService.setOptions('requests', {
|
|
||||||
removeOnSpill: false,
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
this.dragulaService.drop.subscribe((value: any) => {
|
this.dragulaService.drop.subscribe((value: any) => {
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@ export class ServiceHelpers {
|
||||||
// We'd also dig deeper into the error to get a better message
|
// We'd also dig deeper into the error to get a better message
|
||||||
let errMsg = (error.message) ? error.message :
|
let errMsg = (error.message) ? error.message :
|
||||||
error.status ? `${error.status} - ${error.statusText}` : 'Server error';
|
error.status ? `${error.status} - ${error.statusText}` : 'Server error';
|
||||||
console.error(errMsg); // log to console instead
|
|
||||||
return Observable.throw(errMsg);
|
return Observable.throw(errMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +50,6 @@ export class ServiceAuthHelpers {
|
||||||
// We'd also dig deeper into the error to get a better message
|
// We'd also dig deeper into the error to get a better message
|
||||||
let errMsg = (error.message) ? error.message :
|
let errMsg = (error.message) ? error.message :
|
||||||
error.status ? `${error.status} - ${error.statusText}` : 'Server error';
|
error.status ? `${error.status} - ${error.statusText}` : 'Server error';
|
||||||
console.error(errMsg); // log to console instead
|
|
||||||
return Observable.throw(errMsg);
|
return Observable.throw(errMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
<settings-menu></settings-menu>
|
<settings-menu></settings-menu>
|
||||||
<div *ngIf="settings">
|
<div *ngIf="settings">
|
||||||
<form class="form-horizontal" method="POST" id="mainForm">
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Radarr Settings</legend>
|
<legend>Radarr Settings</legend>
|
||||||
|
|
||||||
|
@ -100,5 +99,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
<settings-menu></settings-menu>
|
<settings-menu></settings-menu>
|
||||||
<div *ngIf="settings">
|
<div *ngIf="settings">
|
||||||
<form class="form-horizontal" method="POST" id="mainForm">
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Sonarr Settings</legend>
|
<legend>Sonarr Settings</legend>
|
||||||
|
|
||||||
|
@ -100,5 +99,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue