Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/development' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
MarmadileManteater committed Feb 22, 2025
2 parents 8746a78 + 977d550 commit 9bd5e8e
Show file tree
Hide file tree
Showing 66 changed files with 5,186 additions and 2,926 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ body:
label: Guidelines
description: Please ensure you've completed all of the following.
options:
- label: I have searched the issue tracker for [open](https://github.com/FreeTubeApp/FreeTube/issues?q=is%3Aopen+is%3Aissue) and [closed](https://github.com/FreeTubeApp/FreeTube/issues?q=is%3Aissue+is%3Aclosed) issues that are similar to the feature request I want to file, without success.
- label: I have [searched the issue tracker for open and closed issues](https://github.com/FreeTubeApp/FreeTube/issues?q=is%3Aissue+sort%3Arelevance-desc) that are similar to the feature request I want to file, without success.
required: true
- label: I have searched the [documentation](https://docs.freetubeapp.io/) for information that matches the description of the feature request I want to file, without success.
required: true
Expand Down
69 changes: 37 additions & 32 deletions .github/workflows/release.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
}
],
"a11y/no-outline-none": true,
"liberty/use-logical-spec": ["always", { "except": ["float"] }]
"liberty/use-logical-spec": ["always"]
}
}
Binary file modified _icons/icon.icns
Binary file not shown.
1 change: 1 addition & 0 deletions _scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const Platform = builder.Platform
const Arch = builder.Arch
const args = process.argv

/** @type {Map<import('electron-builder').Platform, Map<import('electron-builder').Arch, Array<string>>>} */
let targets
const platform = os.platform()

Expand Down
1 change: 1 addition & 0 deletions _scripts/ebuilder.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { name, productName } = require('../package.json')

/** @type {import('electron-builder').Configuration} */
const config = {
appId: `io.freetubeapp.${name}`,
copyright: 'Copyleft © 2020-2025 [email protected]',
Expand Down
2 changes: 2 additions & 0 deletions _scripts/webpack.main.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const JsonMinimizerPlugin = require('json-minimizer-webpack-plugin')

const isDevMode = process.env.NODE_ENV === 'development'

/** @type {import('webpack').Configuration} */
const config = {
name: 'main',
mode: process.env.NODE_ENV,
Expand Down Expand Up @@ -40,6 +41,7 @@ const config = {
},
plugins: [
new webpack.DefinePlugin({
'process.platform': `'${process.platform}'`,
'process.env.IS_ELECTRON_MAIN': true
})
],
Expand Down
2 changes: 2 additions & 0 deletions _scripts/webpack.renderer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const processLocalesPlugin = new ProcessLocalesPlugin({
outputDir: 'static/locales',
})

/** @type {import('webpack').Configuration} */
const config = {
name: 'renderer',
mode: process.env.NODE_ENV,
Expand Down Expand Up @@ -122,6 +123,7 @@ const config = {
plugins: [
processLocalesPlugin,
new webpack.DefinePlugin({
'process.platform': `'${process.platform}'`,
'process.env.IS_ELECTRON': true,
'process.env.IS_ELECTRON_MAIN': false,
'process.env.SUPPORTS_LOCAL_API': true,
Expand Down
2 changes: 2 additions & 0 deletions _scripts/webpack.web.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const isDevMode = process.env.NODE_ENV === 'development'

const { version: swiperVersion } = JSON.parse(fs.readFileSync(path.join(__dirname, '../node_modules/swiper/package.json')))

/** @type {import('webpack').Configuration} */
const config = {
name: 'web',
mode: process.env.NODE_ENV,
Expand Down Expand Up @@ -119,6 +120,7 @@ const config = {
},
plugins: [
new webpack.DefinePlugin({
'process.platform': 'undefined',
'process.env.IS_ELECTRON': false,
'process.env.IS_ELECTRON_MAIN': false,
'process.env.SUPPORTS_LOCAL_API': false,
Expand Down
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,64 +68,64 @@
"autolinker": "^4.1.0",
"bgutils-js": "^3.1.3",
"core-js": "^3.35.1",
"electron-context-menu": "^4.0.4",
"marked": "^15.0.6",
"electron-context-menu": "^4.0.5",
"marked": "^15.0.7",
"path-browserify": "^1.0.1",
"portal-vue": "^2.1.7",
"process": "^0.11.10",
"shaka-player": "^4.13.0",
"swiper": "^11.2.1",
"shaka-player": "^4.13.4",
"swiper": "^11.2.4",
"vue": "^2.7.16",
"vue-i18n": "^8.28.2",
"vue-observe-visibility": "^1.0.0",
"vue-router": "^3.6.5",
"vuex": "^3.6.2",
"youtubei.js": "^13.0.0"
"youtubei.js": "^13.1.0"
},
"devDependencies": {
"@babel/core": "^7.26.7",
"@babel/core": "^7.26.9",
"@babel/plugin-transform-class-properties": "^7.25.9",
"@babel/preset-env": "^7.26.7",
"@double-great/stylelint-a11y": "^3.0.3",
"@eslint/js": "^9.19.0",
"@babel/preset-env": "^7.26.9",
"@double-great/stylelint-a11y": "^3.0.4",
"@eslint/js": "^9.21.0",
"@intlify/eslint-plugin-vue-i18n": "^3.2.0",
"babel-loader": "^9.2.1",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^7.1.2",
"css-minimizer-webpack-plugin": "^7.0.0",
"electron": "^34.0.1",
"electron": "^34.2.0",
"electron-builder": "^25.1.8",
"eslint": "^9.19.0",
"eslint": "^9.21.0",
"eslint-plugin-jsdoc": "^50.6.3",
"eslint-plugin-jsonc": "^2.19.1",
"eslint-plugin-unicorn": "^56.0.1",
"eslint-plugin-unicorn": "^57.0.0",
"eslint-plugin-vue": "^9.32.0",
"eslint-plugin-vuejs-accessibility": "^2.4.1",
"eslint-plugin-yml": "^1.16.0",
"globals": "^15.14.0",
"eslint-plugin-yml": "^1.17.0",
"globals": "^16.0.0",
"html-webpack-plugin": "^5.6.3",
"js-yaml": "^4.1.0",
"json-minimizer-webpack-plugin": "^5.0.0",
"lefthook": "^1.10.10",
"lefthook": "^1.10.11",
"mini-css-extract-plugin": "^2.9.2",
"neostandard": "^0.12.0",
"neostandard": "^0.12.1",
"npm-run-all2": "^7.0.2",
"postcss": "^8.5.1",
"postcss": "^8.5.3",
"postcss-scss": "^4.0.9",
"sass": "^1.83.4",
"sass-loader": "^16.0.4",
"sass": "^1.85.0",
"sass-loader": "^16.0.5",
"stylelint": "^16.14.1",
"string-width": "4.2.3",
"strip-ansi": "6.0.1",
"stylelint-config-sass-guidelines": "^12.1.0",
"stylelint-config-standard": "^37.0.0",
"stylelint-high-performance-animation": "^1.10.0",
"stylelint-high-performance-animation": "^1.11.0",
"stylelint-use-logical-spec": "^5.0.1",
"tree-kill": "1.2.2",
"vue-devtools": "^5.1.4",
"vue-eslint-parser": "^9.4.3",
"vue-loader": "^15.10.0",
"webpack": "^5.97.1",
"webpack": "^5.98.0",
"webpack-cli": "^6.0.1",
"webpack-dev-server": "^5.2.0",
"wrap-ansi": "7.0.0",
Expand Down
94 changes: 53 additions & 41 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const IpcChannels = {
GET_SYSTEM_LOCALE: 'get-system-locale',
GET_PICTURES_PATH: 'get-pictures-path',
GET_NAVIGATION_HISTORY: 'get-navigation-history',
SHOW_OPEN_DIALOG: 'show-open-dialog',
SHOW_SAVE_DIALOG: 'show-save-dialog',
STOP_POWER_SAVE_BLOCKER: 'stop-power-save-blocker',
START_POWER_SAVE_BLOCKER: 'start-power-save-blocker',
Expand Down Expand Up @@ -49,83 +48,95 @@ const IpcChannels = {

GENERATE_PO_TOKEN: 'generate-po-token',

CHOOSE_DEFAULT_FOLDER: 'choose-default-folder',
WRITE_SCREENSHOT: 'write-screenshot',
}

const DBActions = {
// The constants in the GENERAL group are usally intermingeled with the ones in other groups, so they need unique values.
// The other groups however are usually not mixed (e.g. HISTORY and PROFILES),
// so they can have similar values (as long as they don't overlap with the GENERAL group).
GENERAL: {
CREATE: 'db-action-create',
FIND: 'db-action-find',
UPSERT: 'db-action-upsert',
DELETE: 'db-action-delete',
DELETE_MULTIPLE: 'db-action-delete-multiple',
DELETE_ALL: 'db-action-delete-all'
CREATE: 0,
FIND: 1,
UPSERT: 2,
DELETE: 3,
DELETE_MULTIPLE: 4,
DELETE_ALL: 5
},

HISTORY: {
OVERWRITE: 'db-action-history-overwrite',
UPDATE_WATCH_PROGRESS: 'db-action-history-update-watch-progress',
UPDATE_PLAYLIST: 'db-action-history-update-playlist',
OVERWRITE: 20,
UPDATE_WATCH_PROGRESS: 21,
UPDATE_PLAYLIST: 22,
},

PROFILES: {
ADD_CHANNEL: 'db-action-profiles-add-channel',
REMOVE_CHANNEL: 'db-action-profiles-remove-channel'
ADD_CHANNEL: 20,
REMOVE_CHANNEL: 21
},

PLAYLISTS: {
UPSERT_VIDEO: 'db-action-playlists-upsert-video-by-playlist-name',
UPSERT_VIDEOS: 'db-action-playlists-upsert-videos-by-playlist-name',
DELETE_VIDEO_ID: 'db-action-playlists-delete-video-by-playlist-name',
DELETE_VIDEO_IDS: 'db-action-playlists-delete-video-ids',
DELETE_ALL_VIDEOS: 'db-action-playlists-delete-all-videos',
UPSERT_VIDEO: 20,
UPSERT_VIDEOS: 21,
DELETE_VIDEO_ID: 22,
DELETE_VIDEO_IDS: 23,
DELETE_ALL_VIDEOS: 24,
},

SUBSCRIPTION_CACHE: {
UPDATE_VIDEOS_BY_CHANNEL: 'db-action-subscriptions-update-videos-by-channel',
UPDATE_LIVE_STREAMS_BY_CHANNEL: 'db-action-subscriptions-update-live-streams-by-channel',
UPDATE_SHORTS_BY_CHANNEL: 'db-action-subscriptions-update-shorts-by-channel',
UPDATE_SHORTS_WITH_CHANNEL_PAGE_SHORTS_BY_CHANNEL: 'db-action-subscriptions-update-shorts-with-channel-page-shorts-by-channel',
UPDATE_COMMUNITY_POSTS_BY_CHANNEL: 'db-action-subscriptions-update-community-posts-by-channel',
UPDATE_VIDEOS_BY_CHANNEL: 20,
UPDATE_LIVE_STREAMS_BY_CHANNEL: 21,
UPDATE_SHORTS_BY_CHANNEL: 22,
UPDATE_SHORTS_WITH_CHANNEL_PAGE_SHORTS_BY_CHANNEL: 23,
UPDATE_COMMUNITY_POSTS_BY_CHANNEL: 24,
},
}

const SyncEvents = {
// The constants in the GENERAL group are usally intermingeled with the ones in other groups, so they need unique values.
// The other groups however are usually not mixed (e.g. HISTORY and PROFILES),
// so they can have similar values (as long as they don't overlap with the GENERAL group).
GENERAL: {
CREATE: 'sync-create',
UPSERT: 'sync-upsert',
DELETE: 'sync-delete',
DELETE_MULTIPLE: 'sync-delete-multiple',
DELETE_ALL: 'sync-delete-all'
CREATE: 0,
UPSERT: 1,
DELETE: 2,
DELETE_MULTIPLE: 3,
DELETE_ALL: 4
},

HISTORY: {
OVERWRITE: 'sync-history-overwrite',
UPDATE_WATCH_PROGRESS: 'sync-history-update-watch-progress',
UPDATE_PLAYLIST: 'sync-history-update-playlist',
OVERWRITE: 20,
UPDATE_WATCH_PROGRESS: 21,
UPDATE_PLAYLIST: 22,
},

PROFILES: {
ADD_CHANNEL: 'sync-profiles-add-channel',
REMOVE_CHANNEL: 'sync-profiles-remove-channel'
ADD_CHANNEL: 20,
REMOVE_CHANNEL: 21
},

PLAYLISTS: {
UPSERT_VIDEO: 'sync-playlists-upsert-video',
UPSERT_VIDEOS: 'sync-playlists-upsert-videos',
DELETE_VIDEO: 'sync-playlists-delete-video',
DELETE_VIDEOS: 'sync-playlists-delete-videos',
UPSERT_VIDEO: 20,
UPSERT_VIDEOS: 21,
DELETE_VIDEO: 22,
DELETE_VIDEOS: 23,
},

SUBSCRIPTION_CACHE: {
UPDATE_VIDEOS_BY_CHANNEL: 'sync-subscriptions-update-videos-by-channel',
UPDATE_LIVE_STREAMS_BY_CHANNEL: 'sync-subscriptions-update-live-streams-by-channel',
UPDATE_SHORTS_BY_CHANNEL: 'sync-subscriptions-update-shorts-by-channel',
UPDATE_SHORTS_WITH_CHANNEL_PAGE_SHORTS_BY_CHANNEL: 'sync-subscriptions-update-shorts-with-channel-page-shorts-by-channel',
UPDATE_COMMUNITY_POSTS_BY_CHANNEL: 'sync-subscriptions-update-community-posts-by-channel',
UPDATE_VIDEOS_BY_CHANNEL: 20,
UPDATE_LIVE_STREAMS_BY_CHANNEL: 21,
UPDATE_SHORTS_BY_CHANNEL: 22,
UPDATE_SHORTS_WITH_CHANNEL_PAGE_SHORTS_BY_CHANNEL: 23,
UPDATE_COMMUNITY_POSTS_BY_CHANNEL: 24,
},
}

const DefaultFolderKind = {
DOWNLOADS: 0,
SCREENSHOTS: 1
}

/*
DEV NOTE: Duplicate any and all changes made here to our [official documentation site here](https://github.com/FreeTubeApp/FreeTube-Docs/blob/master/usage/keyboard-shortcuts.md)
to have them reflect on the [keyboard shortcut reference webpage](https://docs.freetubeapp.io/usage/keyboard-shortcuts).
Expand Down Expand Up @@ -216,6 +227,7 @@ export {
IpcChannels,
DBActions,
SyncEvents,
DefaultFolderKind,
KeyboardShortcuts,
MAIN_PROFILE_ID,
MOBILE_WIDTH_THRESHOLD,
Expand Down
24 changes: 14 additions & 10 deletions src/datastores/handlers/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,8 @@ class Settings {
})
}

static _findBounds() {
return db.settings.findOneAsync({ _id: 'bounds' })
}

static _findTheme() {
return db.settings.findOneAsync({ _id: 'baseTheme' })
static _findOne(_id) {
return db.settings.findOneAsync({ _id })
}

static _findSidenavSettings() {
Expand All @@ -77,10 +73,6 @@ class Settings {
}
}

static _findScreenshotFolderPath() {
return db.settings.findOneAsync({ _id: 'screenshotFolderPath' })
}

static _updateBounds(value) {
return db.settings.updateAsync({ _id: 'bounds' }, { _id: 'bounds', value }, { upsert: true })
}
Expand Down Expand Up @@ -340,6 +332,17 @@ class SubscriptionCache {
}
}

function loadDatastores() {
return Promise.allSettled([
db.settings.loadDatabaseAsync(),
db.history.loadDatabaseAsync(),
db.profiles.loadDatabaseAsync(),
db.playlists.loadDatabaseAsync(),
db.searchHistory.loadDatabaseAsync(),
db.subscriptionCache.loadDatabaseAsync(),
])
}

function compactAllDatastores() {
return Promise.allSettled([
db.settings.compactDatafileAsync(),
Expand All @@ -359,5 +362,6 @@ export {
SearchHistory as searchHistory,
SubscriptionCache as subscriptionCache,

loadDatastores,
compactAllDatastores,
}
12 changes: 6 additions & 6 deletions src/datastores/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ if (process.env.IS_ELECTRON_MAIN) {
dbPath = (dbName) => `${dbName}.db`
}

export const settings = new Datastore({ filename: dbPath('settings'), autoload: true })
export const profiles = new Datastore({ filename: dbPath('profiles'), autoload: true })
export const playlists = new Datastore({ filename: dbPath('playlists'), autoload: true })
export const history = new Datastore({ filename: dbPath('history'), autoload: true })
export const searchHistory = new Datastore({ filename: dbPath('search-history'), autoload: true })
export const subscriptionCache = new Datastore({ filename: dbPath('subscription-cache'), autoload: true })
export const settings = new Datastore({ filename: dbPath('settings'), autoload: !process.env.IS_ELECTRON_MAIN })
export const profiles = new Datastore({ filename: dbPath('profiles'), autoload: !process.env.IS_ELECTRON_MAIN })
export const playlists = new Datastore({ filename: dbPath('playlists'), autoload: !process.env.IS_ELECTRON_MAIN })
export const history = new Datastore({ filename: dbPath('history'), autoload: !process.env.IS_ELECTRON_MAIN })
export const searchHistory = new Datastore({ filename: dbPath('search-history'), autoload: !process.env.IS_ELECTRON_MAIN })
export const subscriptionCache = new Datastore({ filename: dbPath('subscription-cache'), autoload: !process.env.IS_ELECTRON_MAIN })
Loading

0 comments on commit 9bd5e8e

Please sign in to comment.