mirror of
https://github.com/xuthus83/pigallery2.git
synced 2025-01-14 14:43:17 +08:00
Reverting Indexing as it did not improve performance
This commit is contained in:
parent
96e8ec0d89
commit
eb84723523
@ -16,15 +16,8 @@ export class MediaDimensionEntity implements MediaDimension {
|
||||
}
|
||||
|
||||
|
||||
const arrayTransformer: ValueTransformer = {
|
||||
to: (value: string[]): string => value ? value.join(',') : null,
|
||||
from: (value: string): string[] => value ? value.split(',') : null
|
||||
};
|
||||
|
||||
export class MediaMetadataEntity implements MediaMetadata {
|
||||
|
||||
@Index()
|
||||
@Column('varchar', {length: 128})
|
||||
@Column('text')
|
||||
caption: string;
|
||||
|
||||
@Column(type => MediaDimensionEntity)
|
||||
@ -46,11 +39,8 @@ export class MediaMetadataEntity implements MediaMetadata {
|
||||
@Column('int', {unsigned: true})
|
||||
fileSize: number;
|
||||
|
||||
@Index()
|
||||
@Column({
|
||||
type: 'varchar',
|
||||
length: 512,
|
||||
transformer: arrayTransformer,
|
||||
type: 'simple-array',
|
||||
charset: columnCharsetCS.charset,
|
||||
collation: columnCharsetCS.collation
|
||||
})
|
||||
@ -62,7 +52,6 @@ export class MediaMetadataEntity implements MediaMetadata {
|
||||
@Column(type => PositionMetaDataEntity)
|
||||
positionData: PositionMetaDataEntity;
|
||||
|
||||
@Index()
|
||||
@Column('tinyint', {unsigned: true})
|
||||
rating: 0 | 1 | 2 | 3 | 4 | 5;
|
||||
|
||||
@ -75,12 +64,8 @@ export class MediaMetadataEntity implements MediaMetadata {
|
||||
/**
|
||||
* Caches the list of persons. Only used for searching
|
||||
*/
|
||||
@Index()
|
||||
@Column({
|
||||
type: 'varchar',
|
||||
select: false, nullable: true,
|
||||
length: 512,
|
||||
transformer: arrayTransformer,
|
||||
type: 'simple-array', select: false, nullable: true,
|
||||
charset: columnCharsetCS.charset,
|
||||
collation: columnCharsetCS.collation
|
||||
})
|
||||
@ -104,7 +89,6 @@ export abstract class MediaEntity implements MediaDTO {
|
||||
@PrimaryGeneratedColumn({unsigned: true})
|
||||
id: number;
|
||||
|
||||
@Index()
|
||||
@Column(columnCharsetCS)
|
||||
name: string;
|
||||
|
||||
|
@ -10,8 +10,7 @@ export class CameraMetadataEntity implements CameraMetadata {
|
||||
|
||||
|
||||
@Column({
|
||||
type: 'varchar', nullable: true,
|
||||
length: 64,
|
||||
type: 'text', nullable: true,
|
||||
charset: columnCharsetCS.charset,
|
||||
collation: columnCharsetCS.collation
|
||||
})
|
||||
@ -19,8 +18,7 @@ export class CameraMetadataEntity implements CameraMetadata {
|
||||
|
||||
|
||||
@Column({
|
||||
type: 'varchar', nullable: true,
|
||||
length: 64,
|
||||
type: 'text', nullable: true,
|
||||
charset: columnCharsetCS.charset,
|
||||
collation: columnCharsetCS.collation
|
||||
})
|
||||
@ -58,8 +56,7 @@ export class PositionMetaDataEntity implements PositionMetaData {
|
||||
|
||||
@Index()
|
||||
@Column({
|
||||
type: 'varchar', nullable: true,
|
||||
length: 64,
|
||||
type: 'text', nullable: true,
|
||||
charset: columnCharsetCS.charset,
|
||||
collation: columnCharsetCS.collation
|
||||
})
|
||||
@ -67,8 +64,7 @@ export class PositionMetaDataEntity implements PositionMetaData {
|
||||
|
||||
@Index()
|
||||
@Column({
|
||||
type: 'varchar', nullable: true,
|
||||
length: 64,
|
||||
type: 'text', nullable: true,
|
||||
charset: columnCharsetCS.charset,
|
||||
collation: columnCharsetCS.collation
|
||||
})
|
||||
@ -76,8 +72,7 @@ export class PositionMetaDataEntity implements PositionMetaData {
|
||||
|
||||
@Index()
|
||||
@Column({
|
||||
type: 'varchar', nullable: true,
|
||||
length: 64,
|
||||
type: 'text', nullable: true,
|
||||
charset: columnCharsetCS.charset,
|
||||
collation: columnCharsetCS.collation
|
||||
})
|
||||
|
@ -1 +1 @@
|
||||
export const DataStructureVersion = 20;
|
||||
export const DataStructureVersion = 21;
|
||||
|
@ -42,8 +42,12 @@ export class IndexingSettingsComponent extends SettingsComponentDirective<Server
|
||||
|
||||
}
|
||||
|
||||
get Config(): any {
|
||||
return {indexChangesOnly: true};
|
||||
}
|
||||
|
||||
get Progress(): JobProgressDTO {
|
||||
return this.jobsService.progress.value[JobDTOUtils.getHashName(DefaultsJobs[DefaultsJobs.Indexing])];
|
||||
return this.jobsService.progress.value[JobDTOUtils.getHashName(DefaultsJobs[DefaultsJobs.Indexing], this.Config)];
|
||||
}
|
||||
|
||||
|
||||
@ -77,7 +81,7 @@ export class IndexingSettingsComponent extends SettingsComponentDirective<Server
|
||||
this.inProgress = true;
|
||||
this.error = '';
|
||||
try {
|
||||
await this.jobsService.start(DefaultsJobs[DefaultsJobs.Indexing], {indexChangesOnly: true});
|
||||
await this.jobsService.start(DefaultsJobs[DefaultsJobs.Indexing], this.Config);
|
||||
this.notification.info($localize`Folder indexing started`);
|
||||
this.inProgress = false;
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user