mirror of
https://github.com/bpatrik/pigallery2.git
synced 2024-12-23 01:27:14 +02:00
Merge branch 'bugfix/offset-or-ignore' of https://github.com/grasdk/pigallery2 into bugfix/offset-or-ignore
This commit is contained in:
commit
81209975c8
@ -811,9 +811,14 @@ export class SearchManager {
|
|||||||
q.where(
|
q.where(
|
||||||
`(media.metadata.creationDate + (media.metadata.creationDateOffset * 60000)) >= :to${queryId}`,
|
`(media.metadata.creationDate + (media.metadata.creationDateOffset * 60000)) >= :to${queryId}`,
|
||||||
textParam
|
textParam
|
||||||
).orWhere(`media.metadata.creationDate < :from${queryId}`,
|
).orWhere(`(media.metadata.creationDate + (media.metadata.creationDateOffset * 60000)) < :from${queryId}`,
|
||||||
textParam);
|
textParam);
|
||||||
} else {
|
} else {
|
||||||
|
q.where(
|
||||||
|
`media.metadata.creationDate >= :to${queryId}`,
|
||||||
|
textParam
|
||||||
|
).orWhere(`media.metadata.creationDate < :from${queryId}`,
|
||||||
|
textParam);
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -821,10 +826,14 @@ export class SearchManager {
|
|||||||
q.where(
|
q.where(
|
||||||
`(media.metadata.creationDate + (media.metadata.creationDateOffset * 60000)) < :to${queryId}`,
|
`(media.metadata.creationDate + (media.metadata.creationDateOffset * 60000)) < :to${queryId}`,
|
||||||
textParam
|
textParam
|
||||||
).andWhere(`media.metadata.creationDate >= :from${queryId}`,
|
).andWhere(`(media.metadata.creationDate + (media.metadata.creationDateOffset * 60000)) >= :from${queryId}`,
|
||||||
textParam);
|
textParam);
|
||||||
} else {
|
} else {
|
||||||
|
q.where(
|
||||||
|
`media.metadata.creationDate < :to${queryId}`,
|
||||||
|
textParam
|
||||||
|
).andWhere(`media.metadata.creationDate >= :from${queryId}`,
|
||||||
|
textParam);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -845,8 +854,6 @@ export class SearchManager {
|
|||||||
|
|
||||||
|
|
||||||
if (Config.Database.type === DatabaseType.sqlite) {
|
if (Config.Database.type === DatabaseType.sqlite) {
|
||||||
//(media.metadata.creationDate + (media.metadata.creationDateOffset * 60000))
|
|
||||||
|
|
||||||
if (tq.daysLength == 0) {
|
if (tq.daysLength == 0) {
|
||||||
if (Config.Gallery.ignoreTimestampOffset === true) {
|
if (Config.Gallery.ignoreTimestampOffset === true) {
|
||||||
q.where(
|
q.where(
|
||||||
|
@ -128,6 +128,7 @@ describe('CoverManager', (sqlHelper: DBTestHelper) => {
|
|||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await setUpSqlDB();
|
await setUpSqlDB();
|
||||||
|
Config.Gallery.ignoreTimestampOffset = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user