pull/1425/head
Jamie.Rees 8 years ago
commit 9f575d1e64

@ -165,10 +165,11 @@ namespace Ombi.Core.Models.Requests
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>();
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)
continue;

@ -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 CacherException => new EventId(2000);
public static EventId RadarrCacherException => new EventId(2001);
}
}

@ -12,7 +12,6 @@ namespace Ombi.Store.Repository
RequestBlobs Get(int id);
IEnumerable<RequestBlobs> GetAll();
Task<IEnumerable<RequestBlobs>> GetAllAsync();
Task<IEnumerable<RequestBlobs>> GetAllAsync(int count, int position);
Task<RequestBlobs> GetAsync(int id);
RequestBlobs Insert(RequestBlobs entity);
Task<RequestBlobs> InsertAsync(RequestBlobs entity);

@ -62,18 +62,6 @@ namespace Ombi.Store.Repository
//}, 5);
//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)
{

@ -60,6 +60,7 @@ namespace Ombi
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddMemoryCache();
services.AddMvc();
services.AddOmbiMappingProfile();
services.AddAutoMapper(expression =>

@ -58,6 +58,8 @@ var paths = {
'./node_modules/bootstrap/dist/js/bootstrap.js',
'./node_modules/tether/dist/js/tether.js',
'./node_modules/angular2-jwt/angular2-jwt.js',
'./node_modules/dragula/dist/dragula.js'
],
dest: './lib/'
@ -75,7 +77,7 @@ var paths = {
'./node_modules/primeng/resources/primeng.css',
'./node_modules/tether/dist/css/tether.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/'
},

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}}
</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 class="col-md-4">
<md-card>
<div class="landing-box">
<md-card-title>Title</md-card-title>
<div [dragula]='"requests"' [dragulaModel]="tvRequests.new">
<div [dragula]='"requests-bag"' [dragulaModel]="tvRequests.new">
<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>
</md-card>
</div>
</div>
<div class="col-md-4">
<md-card>
<md-card-title>Title</md-card-title>
<div [dragula]='"requests"' [dragulaModel]="tvRequests.approved">
<div class="landing-box">
<div [dragula]='"requests-bag"' [dragulaModel]="tvRequests.approved">
<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>
</md-card>
</div>
</div>
<div class="col-md-4">
<md-card>
<div class="landing-box">
<md-card-title>Title</md-card-title>
<div style="border: dashed">
<div [dragula]='"requests"' [dragulaModel]="tvRequests.available">
<div [dragula]='"requests-bag"' [dragulaModel]="tvRequests.available">
<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>
</md-card>
</div>
</div>
</div>

@ -10,13 +10,7 @@ import { ITvRequestModel, IMovieRequestModel, IRequestGrid } from '../interfaces
export class RequestGridComponent implements OnInit {
constructor(private dragulaService: DragulaService, private requestService: RequestService) {
this.dragulaService.setOptions('requests', {
removeOnSpill: false,
});
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
let errMsg = (error.message) ? error.message :
error.status ? `${error.status} - ${error.statusText}` : 'Server error';
console.error(errMsg); // log to console instead
return Observable.throw(errMsg);
}
@ -51,7 +50,6 @@ export class ServiceAuthHelpers {
// We'd also dig deeper into the error to get a better message
let errMsg = (error.message) ? error.message :
error.status ? `${error.status} - ${error.statusText}` : 'Server error';
console.error(errMsg); // log to console instead
return Observable.throw(errMsg);
}

@ -1,7 +1,6 @@

<settings-menu></settings-menu>
<div *ngIf="settings">
<form class="form-horizontal" method="POST" id="mainForm">
<fieldset>
<legend>Radarr Settings</legend>
@ -100,5 +99,4 @@
</div>
</div>
</fieldset>
</form>
</div>

@ -1,7 +1,6 @@

<settings-menu></settings-menu>
<div *ngIf="settings">
<form class="form-horizontal" method="POST" id="mainForm">
<fieldset>
<legend>Sonarr Settings</legend>
@ -100,5 +99,4 @@
</div>
</div>
</fieldset>
</form>
</div>

Loading…
Cancel
Save