Skip to content

Commit

Permalink
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into fe…
Browse files Browse the repository at this point in the history
…at/keyword-search-history
  • Loading branch information
kommunarr committed Dec 20, 2024
2 parents a6375c7 + 3b63c9b commit 09a4b9b
Show file tree
Hide file tree
Showing 52 changed files with 1,367 additions and 603 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,28 @@ jobs:
asset_path: build/FreeTube-${{ steps.getPackageInfo.outputs.version }}.AppImage
asset_content_type: application/vnd.appimage

- name: Upload AppImage ARMv7l Release
uses: actions/upload-release-asset@v1
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-armv7l')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
asset_name: freetube-${{ steps.getPackageInfo.outputs.version }}-armv7l.AppImage
asset_path: build/FreeTube-${{ steps.getPackageInfo.outputs.version }}-armv7l.AppImage
asset_content_type: application/vnd.appimage

- name: Upload AppImage ARM64 Release
uses: actions/upload-release-asset@v1
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-arm64')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
asset_name: freetube-${{ steps.getPackageInfo.outputs.version }}-arm64.AppImage
asset_path: build/FreeTube-${{ steps.getPackageInfo.outputs.version }}-arm64.AppImage
asset_content_type: application/vnd.appimage

- name: Upload Linux .zip x64 Release
uses: actions/upload-release-asset@v1
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64')
Expand Down Expand Up @@ -371,3 +393,47 @@ jobs:
asset_name: freetube-${{ steps.getPackageInfo.outputs.version }}-mac-arm64.7z
asset_path: build/freetube-${{ steps.getPackageInfo.outputs.version }}-arm64-mac.7z
asset_content_type: application/x-7z-compressed

- name: Upload Alpine .apk x64 Release
uses: actions/upload-release-asset@v1
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
asset_name: freetube-${{ steps.getPackageInfo.outputs.version }}-alpine-amd64.apk
asset_path: build/freetube-${{ steps.getPackageInfo.outputs.version }}.apk
asset_content_type: application/octet-stream

- name: Upload Alpine .apk ARMv7l Release
uses: actions/upload-release-asset@v1
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-armv7l')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
asset_name: freetube-${{ steps.getPackageInfo.outputs.version }}-alpine-armv7l.apk
asset_path: build/freetube-${{ steps.getPackageInfo.outputs.version }}-armv7l.apk
asset_content_type: application/octet-stream

- name: Upload Alpine .apk ARM64 Release
uses: actions/upload-release-asset@v1
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-arm64')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
asset_name: freetube-${{ steps.getPackageInfo.outputs.version }}-alpine-arm64.apk
asset_path: build/freetube-${{ steps.getPackageInfo.outputs.version }}-arm64.apk
asset_content_type: application/octet-stream

- name: Upload Pacman .pacman x64 Release
uses: actions/upload-release-asset@v1
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
asset_name: freetube-${{ steps.getPackageInfo.outputs.version }}-amd64.pacman
asset_path: build/freetube-${{ steps.getPackageInfo.outputs.version }}.pacman
asset_content_type: application/x-zstd-compressed-tar
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,24 @@ longer track you using cookies or JavaScript. Your subscriptions and history are
* Show/hide functionality or elements within the app using the distraction free settings
* View channel community posts

### Browser Extension
FreeTube is supported by the [Privacy Redirect](https://github.com/SimonBrazell/privacy-redirect) and [LibRedirect](https://github.com/libredirect/libredirect) extensions, which will allow you to open YouTube links into FreeTube.
### Browser Extensions
The following extensions open YouTube links directly in FreeTube:

> [!IMPORTANT]
> You must enable the option within the advanced settings of the extension for it to work.
- [LibRedirect](https://libredirect.github.io/)
- [RedirectTube](https://github.com/MStankiewiczOfficial/RedirectTube)

LibRedirect automatically redirect YouTube links to FreeTube.
> [!IMPORTANT]
> To ensure proper functionality, select FreeTube as Frontend in the Services settings of the extension.
RedirectTube, doesn’t automatically open YouTube links in FreeTube. Instead, it adds buttons to the toolbar and context menu, which you can click to open videos in FreeTube manually.

* Download Privacy Redirect for [Firefox](https://addons.mozilla.org/en-US/firefox/addon/privacy-redirect/) or [Google Chrome](https://chrome.google.com/webstore/detail/privacy-redirect/pmcmeagblkinmogikoikkdjiligflglb).
- Download LibRedirect from [Mozilla Add-ons](https://addons.mozilla.org/firefox/addon/libredirect/) (for Firefox based-browsers) or [developer's website](https://libredirect.github.io/download_chromium.html) (for Chrome and Chromium-based browsers).

* Download LibRedirect for [Firefox](https://addons.mozilla.org/firefox/addon/libredirect/) or [Google Chrome](https://libredirect.github.io/download_chromium.html).
- Download RedirectTube from [Mozilla Add-ons](https://addons.mozilla.org/firefox/addon/redirecttube/) (for Firefox based-browsers).

> [!NOTE]
> This extension does not work on Linux portable builds!
> These extensions do not work on Linux portable builds!
>
> If you have issues with the extension working with FreeTube, please create an issue in this repository instead of the extension repository.
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "freetube",
"productName": "FreeTube",
"description": "A private YouTube client",
"version": "0.22.0",
"version": "0.22.1",
"license": "AGPL-3.0-or-later",
"main": "./dist/main.js",
"private": true,
Expand Down Expand Up @@ -63,11 +63,11 @@
"autolinker": "^4.0.0",
"electron-context-menu": "^4.0.4",
"lodash.debounce": "^4.0.8",
"marked": "^15.0.3",
"marked": "^15.0.4",
"path-browserify": "^1.0.1",
"portal-vue": "^2.1.7",
"process": "^0.11.10",
"shaka-player": "^4.12.4",
"shaka-player": "^4.12.5",
"swiper": "^11.1.15",
"vue": "^2.7.16",
"vue-i18n": "^8.28.2",
Expand All @@ -81,15 +81,15 @@
"@babel/plugin-transform-class-properties": "^7.25.9",
"@babel/preset-env": "^7.26.0",
"@double-great/stylelint-a11y": "^3.0.2",
"@eslint/js": "^9.16.0",
"@eslint/js": "^9.17.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": "^33.2.1",
"electron-builder": "^25.1.8",
"eslint": "^9.16.0",
"eslint": "^9.17.0",
"eslint-plugin-jsdoc": "^50.6.1",
"eslint-plugin-jsonc": "^2.18.2",
"eslint-plugin-unicorn": "^56.0.1",
Expand All @@ -107,9 +107,9 @@
"postcss": "^8.4.49",
"postcss-scss": "^4.0.9",
"rimraf": "^6.0.1",
"sass": "^1.82.0",
"sass": "^1.83.0",
"sass-loader": "^16.0.4",
"stylelint": "^16.11.0",
"stylelint": "^16.12.0",
"stylelint-config-sass-guidelines": "^12.1.0",
"stylelint-config-standard": "^36.0.1",
"stylelint-high-performance-animation": "^1.10.0",
Expand Down
5 changes: 1 addition & 4 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ const IpcChannels = {
OPEN_EXTERNAL_LINK: 'open-external-link',
GET_SYSTEM_LOCALE: 'get-system-locale',
GET_PICTURES_PATH: 'get-pictures-path',
GET_NAV_HISTORY_ENTRY_TITLE_AT_INDEX: 'get-navigation-history-entry-at-index',
GET_NAV_HISTORY_ACTIVE_INDEX: 'get-navigation-history-active-index',
GET_NAV_HISTORY_LENGTH: 'get-navigation-history-length',
GO_TO_NAV_HISTORY_OFFSET: 'go-to-navigation-history-index',
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',
Expand Down
12 changes: 6 additions & 6 deletions src/datastores/handlers/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class Playlists {
return db.playlists.removeAsync({ _id, protected: { $ne: true } })
}

static deleteVideoIdByPlaylistId({ _id, videoId, playlistItemId }) {
static deleteVideoIdByPlaylistId(_id, videoId, playlistItemId) {
if (playlistItemId != null) {
return db.playlists.updateAsync(
{ _id },
Expand Down Expand Up @@ -257,31 +257,31 @@ class SubscriptionCache {
return db.subscriptionCache.findAsync({})
}

static updateVideosByChannelId({ channelId, entries, timestamp }) {
static updateVideosByChannelId(channelId, entries, timestamp) {
return db.subscriptionCache.updateAsync(
{ _id: channelId },
{ $set: { videos: entries, videosTimestamp: timestamp } },
{ upsert: true }
)
}

static updateLiveStreamsByChannelId({ channelId, entries, timestamp }) {
static updateLiveStreamsByChannelId(channelId, entries, timestamp) {
return db.subscriptionCache.updateAsync(
{ _id: channelId },
{ $set: { liveStreams: entries, liveStreamsTimestamp: timestamp } },
{ upsert: true }
)
}

static updateShortsByChannelId({ channelId, entries, timestamp }) {
static updateShortsByChannelId(channelId, entries, timestamp) {
return db.subscriptionCache.updateAsync(
{ _id: channelId },
{ $set: { shorts: entries, shortsTimestamp: timestamp } },
{ upsert: true }
)
}

static updateShortsWithChannelPageShortsByChannelId({ channelId, entries }) {
static updateShortsWithChannelPageShortsByChannelId(channelId, entries) {
return db.subscriptionCache.findOneAsync({ _id: channelId }, { shorts: 1 }).then((doc) => {
if (doc == null) { return }

Expand Down Expand Up @@ -314,7 +314,7 @@ class SubscriptionCache {
})
}

static updateCommunityPostsByChannelId({ channelId, entries, timestamp }) {
static updateCommunityPostsByChannelId(channelId, entries, timestamp) {
return db.subscriptionCache.updateAsync(
{ _id: channelId },
{ $set: { communityPosts: entries, communityPostsTimestamp: timestamp } },
Expand Down
12 changes: 6 additions & 6 deletions src/datastores/handlers/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class Playlists {
)
}

static deleteVideoIdByPlaylistId({ _id, videoId, playlistItemId }) {
static deleteVideoIdByPlaylistId(_id, videoId, playlistItemId) {
return ipcRenderer.invoke(
IpcChannels.DB_PLAYLISTS,
{
Expand Down Expand Up @@ -270,7 +270,7 @@ class SubscriptionCache {
)
}

static updateVideosByChannelId({ channelId, entries, timestamp }) {
static updateVideosByChannelId(channelId, entries, timestamp) {
return ipcRenderer.invoke(
IpcChannels.DB_SUBSCRIPTION_CACHE,
{
Expand All @@ -280,7 +280,7 @@ class SubscriptionCache {
)
}

static updateLiveStreamsByChannelId({ channelId, entries, timestamp }) {
static updateLiveStreamsByChannelId(channelId, entries, timestamp) {
return ipcRenderer.invoke(
IpcChannels.DB_SUBSCRIPTION_CACHE,
{
Expand All @@ -290,7 +290,7 @@ class SubscriptionCache {
)
}

static updateShortsByChannelId({ channelId, entries, timestamp }) {
static updateShortsByChannelId(channelId, entries, timestamp) {
return ipcRenderer.invoke(
IpcChannels.DB_SUBSCRIPTION_CACHE,
{
Expand All @@ -300,7 +300,7 @@ class SubscriptionCache {
)
}

static updateShortsWithChannelPageShortsByChannelId({ channelId, entries }) {
static updateShortsWithChannelPageShortsByChannelId(channelId, entries) {
return ipcRenderer.invoke(
IpcChannels.DB_SUBSCRIPTION_CACHE,
{
Expand All @@ -310,7 +310,7 @@ class SubscriptionCache {
)
}

static updateCommunityPostsByChannelId({ channelId, entries, timestamp }) {
static updateCommunityPostsByChannelId(channelId, entries, timestamp) {
return ipcRenderer.invoke(
IpcChannels.DB_SUBSCRIPTION_CACHE,
{
Expand Down
43 changes: 12 additions & 31 deletions src/datastores/handlers/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ class Playlists {
return baseHandlers.playlists.delete(_id)
}

static deleteVideoIdByPlaylistId({ _id, videoId, playlistItemId }) {
return baseHandlers.playlists.deleteVideoIdByPlaylistId({ _id, videoId, playlistItemId })
static deleteVideoIdByPlaylistId(_id, videoId, playlistItemId) {
return baseHandlers.playlists.deleteVideoIdByPlaylistId(_id, videoId, playlistItemId)
}

static deleteVideoIdsByPlaylistId(_id, videoIds) {
Expand Down Expand Up @@ -153,43 +153,24 @@ class SubscriptionCache {
return baseHandlers.subscriptionCache.find()
}

static updateVideosByChannelId({ channelId, entries, timestamp }) {
return baseHandlers.subscriptionCache.updateVideosByChannelId({
channelId,
entries,
timestamp,
})
static updateVideosByChannelId(channelId, entries, timestamp) {
return baseHandlers.subscriptionCache.updateVideosByChannelId(channelId, entries, timestamp)
}

static updateLiveStreamsByChannelId({ channelId, entries, timestamp }) {
return baseHandlers.subscriptionCache.updateLiveStreamsByChannelId({
channelId,
entries,
timestamp,
})
static updateLiveStreamsByChannelId(channelId, entries, timestamp) {
return baseHandlers.subscriptionCache.updateLiveStreamsByChannelId(channelId, entries, timestamp)
}

static updateShortsByChannelId({ channelId, entries, timestamp }) {
return baseHandlers.subscriptionCache.updateShortsByChannelId({
channelId,
entries,
timestamp,
})
static updateShortsByChannelId(channelId, entries, timestamp) {
return baseHandlers.subscriptionCache.updateShortsByChannelId(channelId, entries, timestamp)
}

static updateShortsWithChannelPageShortsByChannelId({ channelId, entries }) {
return baseHandlers.subscriptionCache.updateShortsWithChannelPageShortsByChannelId({
channelId,
entries,
})
static updateShortsWithChannelPageShortsByChannelId(channelId, entries) {
return baseHandlers.subscriptionCache.updateShortsWithChannelPageShortsByChannelId(channelId, entries)
}

static updateCommunityPostsByChannelId({ channelId, entries, timestamp }) {
return baseHandlers.subscriptionCache.updateCommunityPostsByChannelId({
channelId,
entries,
timestamp,
})
static updateCommunityPostsByChannelId(channelId, entries, timestamp) {
return baseHandlers.subscriptionCache.updateCommunityPostsByChannelId(channelId, entries, timestamp)
}

static deleteMultipleChannels(channelIds) {
Expand Down
39 changes: 28 additions & 11 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -898,20 +898,37 @@ function runApp() {

// #region navigation history

ipcMain.on(IpcChannels.GO_TO_NAV_HISTORY_OFFSET, ({ sender }, offset) => {
sender.navigationHistory.goToOffset(offset)
})
const NAV_HISTORY_DISPLAY_LIMIT = 15
// Math.trunc but with a bitwise OR so that it can be calcuated at build time and the number inlined
const HALF_OF_NAV_HISTORY_DISPLAY_LIMIT = (NAV_HISTORY_DISPLAY_LIMIT / 2) | 0

ipcMain.handle(IpcChannels.GET_NAV_HISTORY_ENTRY_TITLE_AT_INDEX, async ({ sender }, index) => {
return sender.navigationHistory.getEntryAtIndex(index)?.title
})
ipcMain.handle(IpcChannels.GET_NAVIGATION_HISTORY, ({ sender }) => {
const activeIndex = sender.navigationHistory.getActiveIndex()
const length = sender.navigationHistory.length()

ipcMain.handle(IpcChannels.GET_NAV_HISTORY_ACTIVE_INDEX, async ({ sender }) => {
return sender.navigationHistory.getActiveIndex()
})
let end

if (activeIndex < HALF_OF_NAV_HISTORY_DISPLAY_LIMIT) {
end = Math.min(length - 1, NAV_HISTORY_DISPLAY_LIMIT - 1)
} else if (length - activeIndex < HALF_OF_NAV_HISTORY_DISPLAY_LIMIT + 1) {
end = length - 1
} else {
end = activeIndex + HALF_OF_NAV_HISTORY_DISPLAY_LIMIT
}

const dropdownOptions = []

for (let index = end; index >= Math.max(0, end + 1 - NAV_HISTORY_DISPLAY_LIMIT); --index) {
const routeLabel = sender.navigationHistory.getEntryAtIndex(index)?.title

dropdownOptions.push({
label: routeLabel,
value: index - activeIndex,
active: index === activeIndex
})
}

ipcMain.handle(IpcChannels.GET_NAV_HISTORY_LENGTH, async ({ sender }) => {
return sender.navigationHistory.length()
return dropdownOptions
})

// #endregion navigation history
Expand Down
Loading

0 comments on commit 09a4b9b

Please sign in to comment.