diff --git a/materialious/android/app/build.gradle b/materialious/android/app/build.gradle index edffd541..9054238c 100644 --- a/materialious/android/app/build.gradle +++ b/materialious/android/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "us.materialio.app" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 103 - versionName "1.7.21" + versionCode 104 + versionName "1.8.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. diff --git a/materialious/electron/materialious.metainfo.xml b/materialious/electron/materialious.metainfo.xml index 0f995f84..30d7f4f8 100644 --- a/materialious/electron/materialious.metainfo.xml +++ b/materialious/electron/materialious.metainfo.xml @@ -64,7 +64,11 @@ - + + + https://github.com/Materialious/Materialious/releases/tag/1.8.0 + + https://github.com/Materialious/Materialious/releases/tag/1.7.21 diff --git a/materialious/electron/package.json b/materialious/electron/package.json index ba6732cc..5c7ab7eb 100644 --- a/materialious/electron/package.json +++ b/materialious/electron/package.json @@ -1,6 +1,6 @@ { "name": "Materialious", - "version": "1.7.21", + "version": "1.8.0", "description": "Modern material design for Invidious.", "author": { "name": "Ward Pearce", @@ -44,4 +44,4 @@ "capacitor", "electron" ] -} +} \ No newline at end of file diff --git a/materialious/package.json b/materialious/package.json index fb5a4533..d5975351 100644 --- a/materialious/package.json +++ b/materialious/package.json @@ -1,6 +1,6 @@ { "name": "materialious", - "version": "1.7.21", + "version": "1.8.0", "private": true, "scripts": { "dev": "vite dev", @@ -72,4 +72,4 @@ "terser": "^5.34.1", "youtubei.js": "^13.4.0" } -} +} \ No newline at end of file diff --git a/materialious/src/lib/css/shaka-player-theme.css b/materialious/src/lib/css/shaka-player-theme.css index 4188a110..3c092ad0 100644 --- a/materialious/src/lib/css/shaka-player-theme.css +++ b/materialious/src/lib/css/shaka-player-theme.css @@ -119,10 +119,6 @@ right: 0.625rem; /* 10px */ bottom: 3.125rem; /* 50px */ min-width: 12.5rem; /* 200px */ - transition: - transform var(--speed3), - border-radius var(--speed3), - padding var(--speed3); } .youtube-theme .shaka-settings-menu { diff --git a/materialious/src/lib/timestamps.ts b/materialious/src/lib/timestamps.ts index a4145b09..0fdd2389 100644 --- a/materialious/src/lib/timestamps.ts +++ b/materialious/src/lib/timestamps.ts @@ -1,81 +1,94 @@ -import { decodeHtmlCharCodes } from "./misc"; -import { convertToSeconds } from "./numbers"; +import { decodeHtmlCharCodes } from './misc'; +import { convertToSeconds } from './numbers'; export interface PhasedDescription { - description: string; - timestamps: { title: string; time: number; timePretty: string; }[]; + description: string; + timestamps: { title: string; time: number; timePretty: string }[]; } export function extractActualLink(url: string): string { - const urlParams = new URLSearchParams(url.split('?')[1]); - const actualLink = urlParams.get('q'); - if (actualLink) { - return decodeURIComponent(actualLink); - } - return url; + const urlParams = new URLSearchParams(url.split('?')[1]); + const actualLink = urlParams.get('q'); + if (actualLink) { + return decodeURIComponent(actualLink); + } + return url; } export function processYoutubeLink(line: string): string { - // Regex to match the tag and extract the href (YouTube redirect link) - const urlRegex = / tag and extract the href (YouTube redirect link) + const urlRegex = /(\d+:\d+(?::\d+)?)<\/a>\s*(.+)/; - const timestampRegexYtJs = new RegExp( - `href="https://www\\.youtube\\.com/watch\\?v=${videoId}(?:&t=(\\d+)s)?"[^>]*>\\s*]*>\\s*([^<]+)\\s*\\s*\\s*]*>\\s*([^<]+)\\s*`, - 'i' - ); + // Regular expressions for different timestamp formats + const urlRegex = /(\d+:\d+(?::\d+)?)<\/a>\s*(.+)/; + const timestampRegexYtJs = new RegExp( + `href="https://www\\.youtube\\.com/watch\\?v=${videoId}(?:&t=(\\d+)s)?"[^>]*>\\s*]*>\\s*([^<]+)\\s*\\s*\\s*]*>\\s*([^<]+)\\s*`, + 'i' + ); - let filteredLines: string[] = []; - lines.forEach((line) => { - const urlMatch = urlRegex.exec(line); - // Use appropriate regex based on the `usingYoutubeJs` flag - const timestampMatch = (fallbackPatch === 'youtubejs' ? timestampRegexYtJs : timestampRegexInvidious).exec(fallbackPatch === 'youtubejs' ? line + '' : line); + const filteredLines: string[] = []; + lines.forEach((line) => { + const urlMatch = urlRegex.exec(line); + // Use appropriate regex based on the `usingYoutubeJs` flag + const timestampMatch = ( + fallbackPatch === 'youtubejs' ? timestampRegexYtJs : timestampRegexInvidious + ).exec(fallbackPatch === 'youtubejs' ? line + '' : line); - if (urlMatch !== null && timestampMatch === null) { - // If line contains a URL but not a timestamp, modify the URL - const modifiedLine = processYoutubeLink(line).replace( - /]+>/g, '').replace(/\n/g, '').trim()), - timePretty: timestamp - }); - } else { - filteredLines.push(line); - } - }); + timestamps.push({ + time: convertToSeconds(time), + // Remove any HTML in the timestamp title. + title: decodeHtmlCharCodes( + title + .replace(/<[^>]+>/g, '') + .replace(/\n/g, '') + .trim() + ), + timePretty: timestamp + }); + } else { + filteredLines.push(line); + } + }); - const filteredContent = filteredLines.join('\n'); + const filteredContent = filteredLines.join('\n'); - return { description: filteredContent, timestamps: timestamps }; -} \ No newline at end of file + return { description: filteredContent, timestamps: timestamps }; +} diff --git a/update_versions.py b/update_versions.py index 33ecba7e..599ca5ea 100644 --- a/update_versions.py +++ b/update_versions.py @@ -3,7 +3,7 @@ import os import re from datetime import datetime -LATEST_VERSION = "1.7.22" +LATEST_VERSION = "1.8.0" RELEASE_DATE = datetime.now().strftime("%Y-%-m-%d") # Format: YYYY-M-D WORKING_DIR = os.path.join(