pull/1425/head
Jamie.Rees 7 years ago
parent 77780900b7
commit c6534652f1

@ -1,4 +1,6 @@
using Microsoft.EntityFrameworkCore;
using System.IO;
using System.Resources;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Ombi.Store.Entities;
@ -15,9 +17,15 @@ namespace Ombi.Store.Context
Database.EnsureCreated();
Database.Migrate();
//#if DEBUG
// var file = File.ReadAllText();
//#else
var file = File.ReadAllText("SqlTables.sql");
//#endif
// Run Script
Database.ExecuteSqlCommand(Sql.SqlTables, 0);
Database.ExecuteSqlCommand(file, 0);
}
public DbSet<RequestBlobs> Requests { get; set; }

@ -4,6 +4,10 @@
<TargetFramework>netstandard1.6</TargetFramework>
</PropertyGroup>
<ItemGroup>
<None Remove="SqlTables.sql" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="1.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.1.1" />
@ -14,6 +18,11 @@
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<Content Include="SqlTables.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Ombi.Helpers\Ombi.Helpers.csproj" />
</ItemGroup>
@ -26,7 +35,7 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Sql.resx">
<Generator>ResXFileCodeGenerator</Generator>
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Sql.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

@ -23,7 +23,7 @@ namespace Ombi.Store {
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Sql {
public class Sql {
private static global::System.Resources.ResourceManager resourceMan;
@ -37,7 +37,7 @@ namespace Ombi.Store {
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Ombi.Store.Sql", typeof(Sql).GetTypeInfo().Assembly);
@ -52,7 +52,7 @@ namespace Ombi.Store {
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
public static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
@ -80,7 +80,7 @@ namespace Ombi.Store {
/// Type INTEGER NOT NULL,
/// Relea [rest of string was truncated]&quot;;.
/// </summary>
internal static string SqlTables {
public static string SqlTables {
get {
return ResourceManager.GetString("SqlTables", resourceCulture);
}

@ -125,18 +125,14 @@ var paths = {
dest: './lib/primeng/'
}
],
sass: [ // Simple sass->css compilation
sass: // Simple sass->css compilation
{
src: ['./Styles/**/*.scss', '!./Styles/primeng/**'],
dest: './css/',
filter: '**/*.css'
},
{
src: path.join(wwwroot, 'app/**/*.scss'),
dest: './app/',
filter: '**/*.css'
}
],
bundle: { // This is the config for the bundler, you shouldn't need to change this
root: './',
dest: './lib/bundle.js',
@ -259,18 +255,12 @@ gulp.task('modules', function () {
})
gulp.task('sass', function () {
var streams = []
for (let module of paths.sass) {
streams.push(
gulp.src(module.src)
.pipe(changed(module.dest, { extension: '.css' }))
.pipe(gulpif(global.full, sourcemaps.init()))
.pipe(sass({ outputStyle: global.full ? 'compressed' : 'nested' }).on('error', sass.logError))
.pipe(gulpif(global.full, sourcemaps.write('maps')))
.pipe(gulp.dest(path.join(paths.wwwroot, module.dest)))
);
}
return merge(streams);
return gulp.src(paths.sass.src)
.pipe(changed(paths.sass.dest))
.pipe(gulpif(global.full, sourcemaps.init()))
.pipe(sass({ outputStyle: global.full ? 'compressed' : 'nested' }).on('error', sass.logError))
.pipe(gulpif(global.full, sourcemaps.write('maps')))
.pipe(gulp.dest(path.join(paths.wwwroot, paths.sass.dest)))
});

@ -8,12 +8,11 @@ import { IdentityService } from './services/identity.service';
import { ICustomizationSettings } from './interfaces/ISettings';
import template from './app.component.html';
@Component({
selector: 'ombi',
moduleId: module.id,
templateUrl: template
templateUrl: './app.component.html'
})
export class AppComponent implements OnInit {

@ -14,7 +14,7 @@ export class EmbyService extends ServiceHelpers {
}
logIn(settings: IEmbySettings): Observable<IEmbySettings> {
return this.http.post(`${this.url}/`, JSON.stringify(settings), { headers: this.headers }).map(this.extractData);
return this.http.post(`${this.url}`, JSON.stringify(settings), { headers: this.headers }).map(this.extractData);
}
}

@ -9,7 +9,7 @@ import { ISonarrRootFolder, ISonarrProfile } from '../../interfaces/ISonarr';
@Injectable()
export class SonarrService extends ServiceAuthHelpers {
constructor(http: AuthHttp) {
super(http, '/api/v1/Sonarr/');
super(http, '/api/v1/Sonarr');
}
getRootFolders(settings: ISonarrSettings): Observable<ISonarrRootFolder[]> {

@ -21,11 +21,11 @@ export class IdentityService extends ServiceAuthHelpers {
}
getUsers(): Observable<IUser[]> {
return this.http.get(`${this.url}/Users`).map(this.extractData);
return this.http.get(`${this.url}Users`).map(this.extractData);
}
getAllAvailableClaims(): Observable<ICheckbox[]> {
return this.http.get(`${this.url}/Claims`).map(this.extractData);
return this.http.get(`${this.url}Claims`).map(this.extractData);
}
createUser(user: IUser): Observable<IUser> {

@ -15,42 +15,42 @@ export class RequestService extends ServiceAuthHelpers {
}
requestMovie(movie: ISearchMovieResult): Observable<IRequestEngineResult> {
return this.http.post(`${this.url}/Movie/`, JSON.stringify(movie), { headers: this.headers }).map(this.extractData);
return this.http.post(`${this.url}Movie/`, JSON.stringify(movie), { headers: this.headers }).map(this.extractData);
}
requestTv(tv: ISearchTvResult): Observable<IRequestEngineResult> {
return this.http.post(`${this.url}/TV/`, JSON.stringify(tv), { headers: this.headers }).map(this.extractData);
return this.http.post(`${this.url}TV/`, JSON.stringify(tv), { headers: this.headers }).map(this.extractData);
}
getMovieRequests(count: number, position: number): Observable<IMovieRequestModel[]> {
return this.http.get(`${this.url}/movie/${count}/${position}`).map(this.extractData);
return this.http.get(`${this.url}movie/${count}/${position}`).map(this.extractData);
}
searchMovieRequests(search: string): Observable<IMovieRequestModel[]> {
return this.http.get(`${this.url}/movie/search/${search}`).map(this.extractData);
return this.http.get(`${this.url}movie/search/${search}`).map(this.extractData);
}
removeMovieRequest(request: IMovieRequestModel) {
this.http.delete(`${this.url}/movie/${request.id}`).map(this.extractData).subscribe();
this.http.delete(`${this.url}movie/${request.id}`).map(this.extractData).subscribe();
}
updateMovieRequest(request: IMovieRequestModel): Observable<IMovieRequestModel> {
return this.http.post(`${this.url}/movie/`, JSON.stringify(request), { headers: this.headers }).map(this.extractData);
return this.http.post(`${this.url}movie/`, JSON.stringify(request), { headers: this.headers }).map(this.extractData);
}
getTvRequests(count: number, position: number): Observable<ITvRequestModel[]> {
return this.http.get(`${this.url}/tv/${count}/${position}`).map(this.extractData);
return this.http.get(`${this.url}tv/${count}/${position}`).map(this.extractData);
}
searchTvRequests(search: string): Observable<ITvRequestModel[]> {
return this.http.get(`${this.url}/tv/search/${search}`).map(this.extractData);
return this.http.get(`${this.url}tv/search/${search}`).map(this.extractData);
}
removeTvRequest(request: ITvRequestModel) {
this.http.delete(`${this.url}/tv/${request.id}`).map(this.extractData).subscribe();
this.http.delete(`${this.url}tv/${request.id}`).map(this.extractData).subscribe();
}
updateTvRequest(request: ITvRequestModel): Observable<ITvRequestModel> {
return this.http.post(`${this.url}/tv/`, JSON.stringify(request), { headers: this.headers }).map(this.extractData);
return this.http.post(`${this.url}tv/`, JSON.stringify(request), { headers: this.headers }).map(this.extractData);
}
}

@ -9,57 +9,58 @@ import { IOmbiSettings, IEmbySettings, IPlexSettings, ISonarrSettings,ILandingPa
@Injectable()
export class SettingsService extends ServiceAuthHelpers {
constructor(public httpAuth: AuthHttp, private nonAuthHttp: Http) {
super(httpAuth, '/api/v1/Settings/');
super(httpAuth, '/api/v1/Settings');
}
getOmbi(): Observable<IOmbiSettings> {
return this.httpAuth.get(`${this.url}/Ombi/`).map(this.extractData);
return this.httpAuth.get(`${this.url}/Ombi/`).map(this.extractData).catch(this.handleError)
}
saveOmbi(settings: IOmbiSettings): Observable<boolean> {
return this.httpAuth.post(`${this.url}/Ombi/`, JSON.stringify(settings), { headers: this.headers }).map(this.extractData);
return this.httpAuth.post(`${this.url}/Ombi/`, JSON.stringify(settings), { headers: this.headers }).map(this.extractData).catch(this.handleError)
}
getEmby(): Observable<IEmbySettings> {
return this.httpAuth.get(`${this.url}/Emby/`).map(this.extractData);
return this.httpAuth.get(`${this.url}/Emby/`).map(this.extractData).catch(this.handleError)
}
saveEmby(settings: IEmbySettings): Observable<boolean> {
return this.httpAuth.post(`${this.url}/Emby/`, JSON.stringify(settings), { headers: this.headers }).map(this.extractData);
return this.httpAuth.post(`${this.url}/Emby/`, JSON.stringify(settings), { headers: this.headers }).map(this.extractData).catch(this.handleError)
}
getPlex(): Observable<IPlexSettings> {
return this.httpAuth.get(`${this.url}/Plex/`).map(this.extractData);
return this.httpAuth.get(`${this.url}/Plex/`).map(this.extractData).catch(this.handleError)
}
savePlex(settings: IPlexSettings): Observable<boolean> {
return this.httpAuth.post(`${this.url}/Plex/`, JSON.stringify(settings), { headers: this.headers }).map(this.extractData);
return this.httpAuth.post(`${this.url}/Plex/`, JSON.stringify(settings), { headers: this.headers }).map(this.extractData).catch(this.handleError)
}
getSonarr(): Observable<ISonarrSettings> {
return this.httpAuth.get(`${this.url}/Sonarr`).map(this.extractData);
return this.httpAuth.get(`${this.url}/Sonarr`).map(this.extractData)
.catch(this.handleError);
}
saveSonarr(settings: ISonarrSettings): Observable<boolean> {
return this.httpAuth.post(`${this.url}/Sonarr`, JSON.stringify(settings), { headers: this.headers }).map(this.extractData);
return this.httpAuth.post(`${this.url}/Sonarr`, JSON.stringify(settings), { headers: this.headers }).map(this.extractData).catch(this.handleError)
}
// Using http since we need it not to be authenticated to get the landing page settings
getLandingPage(): Observable<ILandingPageSettings> {
return this.nonAuthHttp.get(`${this.url}/LandingPage`).map(this.extractData);
return this.nonAuthHttp.get(`${this.url}/LandingPage`).map(this.extractData).catch(this.handleError)
}
saveLandingPage(settings: ILandingPageSettings): Observable<boolean> {
return this.httpAuth.post(`${this.url}/LandingPage`, JSON.stringify(settings), { headers: this.headers }).map(this.extractData);
return this.httpAuth.post(`${this.url}/LandingPage`, JSON.stringify(settings), { headers: this.headers }).map(this.extractData).catch(this.handleError)
}
// Using http since we need it not to be authenticated to get the customization settings
getCustomization(): Observable<ICustomizationSettings> {
return this.nonAuthHttp.get(`${this.url}/customization`).map(this.extractData);
return this.nonAuthHttp.get(`${this.url}/customization`).map(this.extractData).catch(this.handleError)
}
saveCustomization(settings: ICustomizationSettings): Observable<boolean> {
return this.httpAuth.post(`${this.url}/customization`, JSON.stringify(settings), { headers: this.headers }).map(this.extractData);
return this.httpAuth.post(`${this.url}/customization`, JSON.stringify(settings), { headers: this.headers }).map(this.extractData).catch(this.handleError)
}

@ -11,6 +11,6 @@ export class StatusService extends ServiceHelpers {
super(http, '/api/v1/status/');
}
getWizardStatus(): Observable<any> {
return this.http.get(`${this.url}/Wizard/`, { headers: this.headers }).map(this.extractData);
return this.http.get(`${this.url}Wizard/`, { headers: this.headers }).map(this.extractData);
}
}
Loading…
Cancel
Save