mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-16 20:21:30 +03:00
Removed @locl dependency for translations
Added CommonModule to fix intellisense Added ability to load json assets by name, and an http call to update youtubedl-material
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { BrowserModule } from '@angular/platform-browser';
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
||||||
import { NgModule, LOCALE_ID } from '@angular/core';
|
import { NgModule, LOCALE_ID } from '@angular/core';
|
||||||
import { registerLocaleData } from '@angular/common';
|
import { registerLocaleData, CommonModule } from '@angular/common';
|
||||||
import { MatButtonModule } from '@angular/material/button';
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
||||||
import { MatCardModule } from '@angular/material/card';
|
import { MatCardModule } from '@angular/material/card';
|
||||||
@@ -37,7 +37,6 @@ import { PlayerComponent } from './player/player.component';
|
|||||||
import {VgCoreModule, VgControlsModule, VgOverlayPlayModule, VgBufferingModule} from 'ngx-videogular';
|
import {VgCoreModule, VgControlsModule, VgOverlayPlayModule, VgBufferingModule} from 'ngx-videogular';
|
||||||
import { InputDialogComponent } from './input-dialog/input-dialog.component';
|
import { InputDialogComponent } from './input-dialog/input-dialog.component';
|
||||||
import { LazyLoadImageModule, IsVisibleProps } from 'ng-lazyload-image';
|
import { LazyLoadImageModule, IsVisibleProps } from 'ng-lazyload-image';
|
||||||
import { NgxContentLoadingModule } from 'ngx-content-loading';
|
|
||||||
import { audioFilesMouseHovering, videoFilesMouseHovering, audioFilesOpened, videoFilesOpened } from './main/main.component';
|
import { audioFilesMouseHovering, videoFilesMouseHovering, audioFilesOpened, videoFilesOpened } from './main/main.component';
|
||||||
import { CreatePlaylistComponent } from './create-playlist/create-playlist.component';
|
import { CreatePlaylistComponent } from './create-playlist/create-playlist.component';
|
||||||
import { DownloadItemComponent } from './download-item/download-item.component';
|
import { DownloadItemComponent } from './download-item/download-item.component';
|
||||||
@@ -81,6 +80,7 @@ export function isVisible({ event, element, scrollContainer, offset }: IsVisible
|
|||||||
HighlightPipe
|
HighlightPipe
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
|
CommonModule,
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
BrowserAnimationsModule,
|
BrowserAnimationsModule,
|
||||||
MatNativeDateModule,
|
MatNativeDateModule,
|
||||||
@@ -116,7 +116,6 @@ export function isVisible({ event, element, scrollContainer, offset }: IsVisible
|
|||||||
VgOverlayPlayModule,
|
VgOverlayPlayModule,
|
||||||
VgBufferingModule,
|
VgBufferingModule,
|
||||||
LazyLoadImageModule.forRoot({ isVisible }),
|
LazyLoadImageModule.forRoot({ isVisible }),
|
||||||
NgxContentLoadingModule,
|
|
||||||
RouterModule,
|
RouterModule,
|
||||||
AppRoutingModule,
|
AppRoutingModule,
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -10,9 +10,7 @@
|
|||||||
<div *ngIf="!image_errored && thumbnailURL" class="img-div">
|
<div *ngIf="!image_errored && thumbnailURL" class="img-div">
|
||||||
<img class="image" (error) ="onImgError($event)" [id]="type" [lazyLoad]="thumbnailURL" [customObservable]="scrollAndLoad" (onLoad)="imageLoaded($event)" alt="Thumbnail">
|
<img class="image" (error) ="onImgError($event)" [id]="type" [lazyLoad]="thumbnailURL" [customObservable]="scrollAndLoad" (onLoad)="imageLoaded($event)" alt="Thumbnail">
|
||||||
<span *ngIf="!image_loaded">
|
<span *ngIf="!image_loaded">
|
||||||
<ngx-content-loading [width]="500" [height]="360">
|
|
||||||
<svg:g ngx-rect width="500" height="360" y="0" x="0" rx="4" ry="4"></svg:g>
|
|
||||||
</ngx-content-loading>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -94,6 +94,10 @@ export class PostsService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loadAsset(name) {
|
||||||
|
return this.http.get(`./assets/${name}`);
|
||||||
|
}
|
||||||
|
|
||||||
setConfig(config) {
|
setConfig(config) {
|
||||||
return this.http.post(this.path + 'setConfig', {new_config_file: config});
|
return this.http.post(this.path + 'setConfig', {new_config_file: config});
|
||||||
}
|
}
|
||||||
@@ -180,6 +184,11 @@ export class PostsService {
|
|||||||
return this.http.post(this.path + 'getAllSubscriptions', {});
|
return this.http.post(this.path + 'getAllSubscriptions', {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// updates the server to the latest version
|
||||||
|
updateServer() {
|
||||||
|
return this.http.post(this.path + 'updateServer', {});
|
||||||
|
}
|
||||||
|
|
||||||
// gets tag of the latest version of youtubedl-material
|
// gets tag of the latest version of youtubedl-material
|
||||||
getLatestGithubRelease() {
|
getLatestGithubRelease() {
|
||||||
return this.http.get('https://api.github.com/repos/tzahi12345/youtubedl-material/releases/latest');
|
return this.http.get('https://api.github.com/repos/tzahi12345/youtubedl-material/releases/latest');
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|||||||
import { environment } from './environments/environment';
|
import { environment } from './environments/environment';
|
||||||
|
|
||||||
import { loadTranslations } from '@angular/localize';
|
import { loadTranslations } from '@angular/localize';
|
||||||
import { getTranslations, ParsedTranslationBundle } from '@locl/core';
|
|
||||||
|
|
||||||
if (environment.production) {
|
if (environment.production) {
|
||||||
enableProdMode();
|
enableProdMode();
|
||||||
@@ -17,8 +16,7 @@ if (!locale) {
|
|||||||
localStorage.setItem('locale', 'en');
|
localStorage.setItem('locale', 'en');
|
||||||
}
|
}
|
||||||
if (locale && locale !== 'en') {
|
if (locale && locale !== 'en') {
|
||||||
getTranslations(`./assets/i18n/messages.${locale}.json`).then(
|
fetch(`./assets/i18n/messages.${locale}.json`).then(res => res.json()).then((data) => {
|
||||||
(data: ParsedTranslationBundle) => {
|
|
||||||
loadTranslations(data as any);
|
loadTranslations(data as any);
|
||||||
import('./app/app.module').then(module => {
|
import('./app/app.module').then(module => {
|
||||||
platformBrowserDynamic()
|
platformBrowserDynamic()
|
||||||
|
|||||||
Reference in New Issue
Block a user