-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Movie indexer and make indexing more generic
- Loading branch information
1 parent
a9e772e
commit 4af69fe
Showing
11 changed files
with
71 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export const Regexes = { | ||
VideoFile: /([\w\s]+)(?: \((\d{4})\))?.mpd$/, | ||
VideoFile: /([\w\s':.-]+)(?: \((\d{4})\))?.mpd$/, | ||
Thumbnail: /thumb\d*\.(jpg|jpeg|png)$/, | ||
Poster: /poster\d*\.(jpg|jpeg|png)$/, | ||
}; |
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
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 |
---|---|---|
@@ -1,4 +1,20 @@ | ||
import { ILibrary } from 'ipmc-interfaces'; | ||
|
||
export interface IIndexFetcher<TIndex> { | ||
/** | ||
* Fetches the index of the specified CID. | ||
* @param cid cid to index. | ||
*/ | ||
fetchIndex(cid: string): Promise<TIndex>; | ||
|
||
/** | ||
* Checks wheter the indexer can handler specified {@link ILibrary}. | ||
* @param library library to check compatibility for. | ||
*/ | ||
canIndex(library: ILibrary): boolean; | ||
|
||
/** | ||
* Version of the indexer. | ||
*/ | ||
version: string; | ||
} |
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
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
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
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,7 @@ | ||
export interface HasYear { | ||
year: number; | ||
} | ||
|
||
export function isYearFeature(item: any): item is HasYear { | ||
return item !== undefined && typeof item.year === 'number'; | ||
} |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
export type { HasPoster } from './HasPoster'; | ||
export { isPosterFeature } from './HasPoster'; | ||
export type { HasTitle } from './HasTitle'; | ||
export { isTitleFeature } from './HasTitle'; | ||
export { type HasPoster, isPosterFeature } from './HasPoster'; | ||
export { type HasTitle, isTitleFeature } from './HasTitle'; | ||
export { type HasYear, isYearFeature } from './HasYear'; |
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
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
export type { IGenericLibrary } from './IGenericLibrary'; | ||
export type { ILibrary, IMovieLibrary } from './ILibrary'; | ||
export { isMovieLibrary, isMusicLibrary, isSeriesLibrary } from './ILibrary'; | ||
export type { IMovieMetaData } from './IMovieMetaData'; | ||
export type { IEpisodeMetaData, ISeriesMetaData, ISeasonMetaData } from './ISeriesMetaData'; | ||
export { LibraryType } from './LibraryType'; |
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