diff --git a/CHANGELOG.md b/CHANGELOG.md index 9abc5e6e..3b7fe412 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- YouTube account support. The following features are now available: + - The ability to login to one or multiple accounts + - Both YouTube accounts and Invidious accounts are supported side-by-side + - Subscritions + - User playlists + - Watch History + - Watched videos on Playlet are added to the watch history + - Subscribe/Unsubscribe + - Recommended videos for logged in YouTube user are available in the home screen + - This feed can be enabled/disabled from the settings + - When an Invidious user is logged in, this becomes "popular" since Invidious does not support recommendations + ### Fixed - A bug where Session data did not refresh after 24 hours diff --git a/README.md b/README.md index b7660ad2..89ffb2d1 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ Can't install from the store? See [How to install Playlet as a sideloaded/dev ap - 🔥 No Ads (Not now, not ever) - 🕵️ No Tracking - 🛡️ Privacy driven (uses [Invidious](https://invidious.io/) backend) +- 🙋 User accounts (YouTube and Invidious accounts) - ⚔️ [SponsorBlock](https://sponsor.ajay.app/) integration (skips undesirable sections in videos) - 📱 Browse, search, and cast from phone using the YouTube app or the browser - 🔮 Picture-in-picture mode diff --git a/playlet-lib/src/components/MainScene.bs b/playlet-lib/src/components/MainScene.bs index e362141b..fc9016dc 100644 --- a/playlet-lib/src/components/MainScene.bs +++ b/playlet-lib/src/components/MainScene.bs @@ -40,6 +40,7 @@ function MainSceneContainerChanged() InitEcpArgs() m.scene.signalBeacon("AppLaunchComplete") CopyLoadingMessagesToCache() + ShowAnnouncement() end function function StartWebServer() @@ -55,14 +56,14 @@ end function function ShowAnnouncement() as void dialog = DialogUtils.ShowDialogOnce({ - messageId: "1736288537" - title: "Announcement - Playlet backend" + messageId: "1747362859" + title: "Announcement - YouTube account support" message: [ - "An experimental built-in backend has been added to Playlet." - "This allows you to access YouTube content without the need for an Invidious instance." - "To use it, go to the Settings > Invidious > Instance and set the field to empty (Edit, and delete the url)." - "Please note that it's missing some features and may not work as expected." - "Thank you for using Playlet!" + "YouTube account support is now available in Playlet!" + `Subscriptions, playlists, watch history and "Recommended" are now available in the app.` + "If you encounter any issues, please report them on GitHub." + "https://github.com/iBicha/playlet/issues" + "Thank you." ] alwaysOnTop: true marginWidth: 180 diff --git a/playlet-lib/src/components/MainScene.transpiled.brs b/playlet-lib/src/components/MainScene.transpiled.brs index 3ad23111..1208a61b 100644 --- a/playlet-lib/src/components/MainScene.transpiled.brs +++ b/playlet-lib/src/components/MainScene.transpiled.brs @@ -39,6 +39,7 @@ function MainSceneContainerChanged() InitEcpArgs() m.scene.signalBeacon("AppLaunchComplete") CopyLoadingMessagesToCache() + ShowAnnouncement() end function function StartWebServer() @@ -52,14 +53,14 @@ end function function ShowAnnouncement() as void dialog = DialogUtils_ShowDialogOnce({ - messageId: "1736288537" - title: "Announcement - Playlet backend" + messageId: "1747362859" + title: "Announcement - YouTube account support" message: [ - "An experimental built-in backend has been added to Playlet." - "This allows you to access YouTube content without the need for an Invidious instance." - "To use it, go to the Settings > Invidious > Instance and set the field to empty (Edit, and delete the url)." - "Please note that it's missing some features and may not work as expected." - "Thank you for using Playlet!" + "YouTube account support is now available in Playlet!" + "Subscriptions, playlists, watch history and " + chr(34) + "Recommended" + chr(34) + " are now available in the app." + "If you encounter any issues, please report them on GitHub." + "https://github.com/iBicha/playlet/issues" + "Thank you." ] alwaysOnTop: true marginWidth: 180 diff --git a/playlet-lib/src/components/Screens/ProfileScreen/ProfileScreen.bs b/playlet-lib/src/components/Screens/ProfileScreen/ProfileScreen.bs index 833c2700..48a20546 100644 --- a/playlet-lib/src/components/Screens/ProfileScreen/ProfileScreen.bs +++ b/playlet-lib/src/components/Screens/ProfileScreen/ProfileScreen.bs @@ -40,14 +40,9 @@ function OnRowItemSelected() as void row = m.profileRowList.content.GetChild(0) selectedProfile = row.GetChild(index) if selectedProfile.type = "login" - #if YT_OAUTH_SUPPORT - backendTypeSelectionView = BackendTypeSelectionViewUtils.Open(m.appController) - backendTypeSelectionView.observeFieldScoped("selectedBackendType", FuncName(OnBackEndSelected)) - return - #else - LoginWithInvidious() - return - #end if + backendTypeSelectionView = BackendTypeSelectionViewUtils.Open(m.appController) + backendTypeSelectionView.observeFieldScoped("selectedBackendType", FuncName(OnBackEndSelected)) + return end if ProfileViewUtils.Open(selectedProfile, m.appController) diff --git a/playlet-lib/src/components/Services/Preferences/Preferences.bs b/playlet-lib/src/components/Services/Preferences/Preferences.bs index 752f4c9a..8a833dba 100644 --- a/playlet-lib/src/components/Services/Preferences/Preferences.bs +++ b/playlet-lib/src/components/Services/Preferences/Preferences.bs @@ -122,28 +122,26 @@ function MigrateExistingPreferences(userPrefs as object) as boolean isDirty = true end if - #if YT_OAUTH_SUPPORT - if userPrefs.__version = 2 - if IsArray(userPrefs["misc.home_screen_layout"]) - homeScreenLayout = userPrefs["misc.home_screen_layout"] - hasRecommended = false - for each item in homeScreenLayout - if item.id = "recommended" - hasRecommended = true - exit for - end if - end for - if not hasRecommended - homeScreenLayout.Unshift({ - id: "recommended" - enabled: true - }) + if userPrefs.__version = 2 + if IsArray(userPrefs["misc.home_screen_layout"]) + homeScreenLayout = userPrefs["misc.home_screen_layout"] + hasRecommended = false + for each item in homeScreenLayout + if item.id = "recommended" + hasRecommended = true + exit for end if + end for + if not hasRecommended + homeScreenLayout.Unshift({ + id: "recommended" + enabled: true + }) end if - userPrefs.__version = 3 - isDirty = true end if - #end if + userPrefs.__version = 3 + isDirty = true + end if ' TODO:P2 handle case where saved preferences version is higher than current version (e.g. user downgraded) return isDirty diff --git a/playlet-lib/src/config/preferences.json5 b/playlet-lib/src/config/preferences.json5 index 16d6dd3c..e9703ac4 100644 --- a/playlet-lib/src/config/preferences.json5 +++ b/playlet-lib/src/config/preferences.json5 @@ -152,11 +152,10 @@ id: "subscriptions", enabled: true, }, - // YT_OAUTH_SUPPORT - // { - // id: "recommended", - // enabled: true, - // }, + { + id: "recommended", + enabled: true, + }, { id: "trending", enabled: true, diff --git a/playlet-lib/src/manifest b/playlet-lib/src/manifest index a8252044..90463d75 100644 --- a/playlet-lib/src/manifest +++ b/playlet-lib/src/manifest @@ -13,4 +13,4 @@ hidden=1 git_commit_sha=unknown -bs_const=DEBUG=false;YT_OAUTH_SUPPORT=false +bs_const=DEBUG=false \ No newline at end of file