Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the comic import feature [#539]
* Comic files can be discovered, selected and imported.
- Loading branch information
Showing
22 changed files
with
1,394 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
comixed-web/src/app/comic-import/actions/comic-import.actions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* ComiXed - A digital comic book library management application. | ||
* Copyright (C) 2020, The ComiXed Project | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses> | ||
*/ | ||
|
||
import { createAction, props } from '@ngrx/store'; | ||
import { ComicFile } from '@app/comic-import/models/comic-file'; | ||
|
||
export const loadComicFiles = createAction( | ||
'[ComicImport] Load comics in a file system', | ||
props<{ directory: string; maximum: number }>() | ||
); | ||
export const comicFilesLoaded = createAction( | ||
'[ComicImport] Loaded comics in a file system', | ||
props<{ files: ComicFile[] }>() | ||
); | ||
export const loadComicFilesFailed = createAction( | ||
'[ComicImport] Failed to load comic files in a file system' | ||
); | ||
export const setComicFilesSelectedState = createAction( | ||
'[ComicImport] Set the selected state on comic files', | ||
props<{ files: ComicFile[]; selected: boolean }>() | ||
); | ||
export const clearComicFileSelections = createAction( | ||
'[ComicImport] Clear all selected comic files' | ||
); | ||
export const sendComicFiles = createAction( | ||
'[ComicImport] Begin importing the selected comic files', | ||
props<{ | ||
files: ComicFile[]; | ||
ignoreMetadata: boolean; | ||
deleteBlockedPages: boolean; | ||
}>() | ||
); | ||
export const comicFilesSent = createAction( | ||
'[ComicImport] Importing comic files has started' | ||
); | ||
export const sendComicFilesFailed = createAction( | ||
'[ComicImport] Failed to begin importing comic files' | ||
); | ||
export const setImportingComicsState = createAction( | ||
'[ComicImport] Explicitly sets the importing state', | ||
props<{ importing: boolean }>() | ||
); |
22 changes: 22 additions & 0 deletions
22
comixed-web/src/app/comic-import/comic-import.constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* ComiXed - A digital comic book library management application. | ||
* Copyright (C) 2020, The ComiXed Project | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses> | ||
*/ | ||
|
||
import { API_ROOT_URL } from '../core'; | ||
|
||
export const LOAD_COMIC_FILES_URL = `${API_ROOT_URL}/files/contents`; | ||
export const SEND_COMIC_FILES_URL = `${API_ROOT_URL}/files/import`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* ComiXed - A digital comic book library management application. | ||
* Copyright (C) 2020, The ComiXed Project | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses> | ||
*/ | ||
|
||
import { ComicFile } from './models/comic-file'; | ||
|
||
export const ROOT_DIRECTORY = '/home/comixedadmin/Documents/comics'; | ||
|
||
export const COMIC_FILE_1: ComicFile = { | ||
id: 1, | ||
filename: '/Users/comixed/Documents/comics/existing-comic-file.cbz', | ||
baseFilename: 'existing-comic-file', | ||
size: 65535 | ||
}; | ||
|
||
export const COMIC_FILE_2: ComicFile = { | ||
id: 2, | ||
filename: '/Users/comixed/Documents/comics/another-comic-file.cbz', | ||
baseFilename: 'another-comic-file', | ||
size: 32767 | ||
}; | ||
|
||
export const COMIC_FILE_3: ComicFile = { | ||
id: 3, | ||
filename: '/Users/comixed/Documents/comics/this-comic-file.cbz', | ||
baseFilename: 'this-comic-file', | ||
size: 46787 | ||
}; | ||
|
||
export const COMIC_FILE_4: ComicFile = { | ||
id: 4, | ||
filename: '/Users/comixed/Documents/comics/that-comic-file.cbz', | ||
baseFilename: 'that-comic-file', | ||
size: 56213 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* ComiXed - A digital comic book library management application. | ||
* Copyright (C) 2020, The ComiXed Project | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses> | ||
*/ | ||
|
||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { CoreModule } from '../core/core.module'; | ||
import { ImportComicsComponent } from './pages/import-comics/import-comics.component'; | ||
import { ImportToolbarComponent } from './components/import-toolbar/import-toolbar.component'; | ||
import { ComicImportRoutingModule } from '@app/comic-import/comic-import-routing.module'; | ||
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; | ||
import { MatInputModule } from '@angular/material/input'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
import { MatSelectModule } from '@angular/material/select'; | ||
import { MatButtonModule } from '@angular/material/button'; | ||
import { StoreModule } from '@ngrx/store'; | ||
import { | ||
COMIC_IMPORT_FEATURE_KEY, | ||
reducer as comicImportReducer, | ||
} from '@app/comic-import/reducers/comic-import.reducer'; | ||
import { EffectsModule } from '@ngrx/effects'; | ||
import { ComicImportEffects } from '@app/comic-import/effects/comic-import.effects'; | ||
import { ComicFileListComponent } from './components/comic-file-list/comic-file-list.component'; | ||
import { MatTableModule } from '@angular/material/table'; | ||
import { ComicFileCoverUrlPipe } from './pipes/comic-file-cover-url.pipe'; | ||
import { ComicFileDetailsComponent } from './components/comic-file-details/comic-file-details.component'; | ||
import { MatGridListModule } from '@angular/material/grid-list'; | ||
import { FlexModule } from '@angular/flex-layout'; | ||
import { MatCheckboxModule } from '@angular/material/checkbox'; | ||
import { MatSortModule } from '@angular/material/sort'; | ||
import { MatCardModule } from '@angular/material/card'; | ||
import { MatTooltipModule } from '@angular/material/tooltip'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
ImportComicsComponent, | ||
ImportToolbarComponent, | ||
ComicFileListComponent, | ||
ComicFileCoverUrlPipe, | ||
ComicFileDetailsComponent, | ||
], | ||
imports: [ | ||
CommonModule, | ||
CoreModule, | ||
ComicImportRoutingModule, | ||
ReactiveFormsModule, | ||
TranslateModule.forRoot(), | ||
StoreModule.forFeature(COMIC_IMPORT_FEATURE_KEY, comicImportReducer), | ||
EffectsModule.forFeature([ComicImportEffects]), | ||
MatInputModule, | ||
MatSelectModule, | ||
MatButtonModule, | ||
MatTableModule, | ||
MatGridListModule, | ||
FlexModule, | ||
MatCheckboxModule, | ||
MatSortModule, | ||
MatCardModule, | ||
MatTooltipModule, | ||
FormsModule, | ||
], | ||
exports: [CommonModule, CoreModule], | ||
}) | ||
export class ComicImportModule {} |
Oops, something went wrong.