]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/search/advanced-search.model.ts
Merge branch 'release/v1.3.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / search / advanced-search.model.ts
index 1d6c89282ed212195d599059f2aa002edc0c362f..5b713e14550120785bff6dca2ee3604883d25eb9 100644 (file)
@@ -4,6 +4,9 @@ export class AdvancedSearch {
   startDate: string // ISO 8601
   endDate: string // ISO 8601
 
+  originallyPublishedStartDate: string // ISO 8601
+  originallyPublishedEndDate: string // ISO 8601
+
   nsfw: NSFWQuery
 
   categoryOneOf: string
@@ -23,6 +26,8 @@ export class AdvancedSearch {
   constructor (options?: {
     startDate?: string
     endDate?: string
+    originallyPublishedStartDate?: string
+    originallyPublishedEndDate?: string
     nsfw?: NSFWQuery
     categoryOneOf?: string
     licenceOneOf?: string
@@ -37,6 +42,9 @@ export class AdvancedSearch {
 
     this.startDate = options.startDate || undefined
     this.endDate = options.endDate || undefined
+    this.originallyPublishedStartDate = options.originallyPublishedStartDate || undefined
+    this.originallyPublishedEndDate = options.originallyPublishedEndDate || undefined
+
     this.nsfw = options.nsfw || undefined
     this.categoryOneOf = options.categoryOneOf || undefined
     this.licenceOneOf = options.licenceOneOf || undefined
@@ -53,7 +61,7 @@ export class AdvancedSearch {
   }
 
   containsValues () {
-    const obj: any = this.toUrlObject()
+    const obj = this.toUrlObject()
     for (const k of Object.keys(obj)) {
       if (k === 'sort') continue // Exception
 
@@ -66,6 +74,8 @@ export class AdvancedSearch {
   reset () {
     this.startDate = undefined
     this.endDate = undefined
+    this.originallyPublishedStartDate = undefined
+    this.originallyPublishedEndDate = undefined
     this.nsfw = undefined
     this.categoryOneOf = undefined
     this.licenceOneOf = undefined
@@ -82,6 +92,8 @@ export class AdvancedSearch {
     return {
       startDate: this.startDate,
       endDate: this.endDate,
+      originallyPublishedStartDate: this.originallyPublishedStartDate,
+      originallyPublishedEndDate: this.originallyPublishedEndDate,
       nsfw: this.nsfw,
       categoryOneOf: this.categoryOneOf,
       licenceOneOf: this.licenceOneOf,
@@ -98,6 +110,8 @@ export class AdvancedSearch {
     return {
       startDate: this.startDate,
       endDate: this.endDate,
+      originallyPublishedStartDate: this.originallyPublishedStartDate,
+      originallyPublishedEndDate: this.originallyPublishedEndDate,
       nsfw: this.nsfw,
       categoryOneOf: this.intoArray(this.categoryOneOf),
       licenceOneOf: this.intoArray(this.licenceOneOf),
@@ -113,7 +127,7 @@ export class AdvancedSearch {
   size () {
     let acc = 0
 
-    const obj: any = this.toUrlObject()
+    const obj = this.toUrlObject()
     for (const k of Object.keys(obj)) {
       if (k === 'sort') continue // Exception