diff --git a/capacitor.config.ts b/capacitor.config.ts index 8db1696..5064675 100644 --- a/capacitor.config.ts +++ b/capacitor.config.ts @@ -6,7 +6,11 @@ const config: CapacitorConfig = { loggingBehavior: "none", webDir: 'www', server: { - androidScheme: 'https' + androidScheme: 'https', + allowNavigation: [ + "https://drive.google.com", + "https://docs.google.com" + ] }, plugins: { CapacitorSQLite: { diff --git a/src/app/pages/home/home.page.html b/src/app/pages/home/home.page.html index bd0d34b..ef8f876 100644 --- a/src/app/pages/home/home.page.html +++ b/src/app/pages/home/home.page.html @@ -57,7 +57,7 @@ - + diff --git a/src/app/pages/mypitara/mypitara.page.html b/src/app/pages/mypitara/mypitara.page.html index 02c1d28..7dc7cb4 100644 --- a/src/app/pages/mypitara/mypitara.page.html +++ b/src/app/pages/mypitara/mypitara.page.html @@ -21,8 +21,8 @@ - - + +
{{content.metaData.name |translate}}
diff --git a/src/app/pages/playlist-details/playlist-details.page.html b/src/app/pages/playlist-details/playlist-details.page.html index 56a9627..837a1e3 100644 --- a/src/app/pages/playlist-details/playlist-details.page.html +++ b/src/app/pages/playlist-details/playlist-details.page.html @@ -6,22 +6,12 @@
- - + - - - - - - + diff --git a/src/app/pages/qr-scan-result/qr-scan-result.page.html b/src/app/pages/qr-scan-result/qr-scan-result.page.html index b72bc8e..0bfdc93 100644 --- a/src/app/pages/qr-scan-result/qr-scan-result.page.html +++ b/src/app/pages/qr-scan-result/qr-scan-result.page.html @@ -35,7 +35,7 @@ - +
diff --git a/src/app/pages/search/search.page.html b/src/app/pages/search/search.page.html index 00ba040..de6a188 100644 --- a/src/app/pages/search/search.page.html +++ b/src/app/pages/search/search.page.html @@ -56,9 +56,8 @@ - - +
diff --git a/src/app/pages/view-all/view-all.page.html b/src/app/pages/view-all/view-all.page.html index 10d8e41..355d30f 100644 --- a/src/app/pages/view-all/view-all.page.html +++ b/src/app/pages/view-all/view-all.page.html @@ -8,8 +8,8 @@ - - + +
diff --git a/src/app/services/api/http.capacitor.adapter.ts b/src/app/services/api/http.capacitor.adapter.ts index 58ca641..d165a9f 100644 --- a/src/app/services/api/http.capacitor.adapter.ts +++ b/src/app/services/api/http.capacitor.adapter.ts @@ -111,6 +111,20 @@ export class HttpCapacitorAdapter implements HttpClient { return match ? match[1] : null; } + + convertGoogleDriveUrl(driveUrl: string): string | null { + const regex = /\/d\/([a-zA-Z0-9_-]+)\//; + const match = driveUrl.match(regex); + + if (match && match[1]) { + const fileId = match[1]; + return `https://drive.google.com/thumbnail?id=${fileId}`; + } + + return null; // Return null if no match + } + + private invokeRequest(type: ApiHttpRequestType, url: string, parametersOrData: any, headers: { [key: string]: string }): Observable { const observable = new Subject(); @@ -144,7 +158,8 @@ export class HttpCapacitorAdapter implements HttpClient { receivedData.data.djp_contents.forEach((item : any) => { // let mimetype = item?.url ? this.checkMimieType(item?.url) : 'text/html'; let url = this.isGoogleDriveLink(item?.url) ? item?.url.replace('/view', '/preview'): item?.url; - let thumbnail = item?.thumbnail != null && this.isGoogleDriveLink(item?.thumbnail) ? "" : ""; + item.thumbnail = (item?.thumbnail != null && this.isGoogleDriveLink(item?.thumbnail)) ? this.convertGoogleDriveUrl(item?.thumbnail): item?.thumbnail; + let mimetype = this.checkMimieType(url); // Traverse through the items array of each provider const content: SearchContentMetaData = { @@ -162,7 +177,7 @@ export class HttpCapacitorAdapter implements HttpClient { provider_name: item.provider_name, name: item.name, description: item.description, - thumbnail: thumbnail, + thumbnail: item?.thumbnail, domain: item.domain, unique_id: item.unique_id, language: item.language,