Skip to content

Disabled news check #314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Changelog

## v3.1.8
## v3.1.9

<!--Releasenotes start-->
- Temporarily disabled the news feature.
<!--Releasenotes end-->

## v3.1.8

- The button's tooltip may now show additional information on the shuffle status.
- The extension will now show that a shuffle is still running when navigating within a channel.
- Fixed a bug where an active shuffle would continue in the background when navigating to a different channel.
Expand All @@ -11,7 +16,6 @@
- Fixed a bug where the playlist created by the extension would sometimes not be renamed correctly.
- Fixed an animation bug when ignoring shorts and shuffling a channel with many videos from a shorts page.
- Fixed the shuffle button not being added to the channel page if the browser is using a new YouTube UI.
<!--Releasenotes end-->

## v3.1.7

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "random-youtube-video",
"version": "3.1.8",
"version": "3.1.9",
"description": "Customize, shuffle and play random videos from any YouTube channel.",
"scripts": {
"dev": "concurrently \"npm run dev:chromium\" \"npm run dev:firefox\"",
Expand Down
3 changes: 2 additions & 1 deletion src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
}

await checkLocalStorageCapacity();
await checkForAndShowNews();
// TODO: Temporarily disabled due to too many read operations, need to investigate why
// await checkForAndShowNews();
}

// Make sure we are not using too much local storage
Expand All @@ -54,7 +55,7 @@
const localStorageContents = await chrome.storage.local.get();

// We only need the keys that hold playlists, which is signified by the existence of the "videos" sub-key
const allPlaylists = Object.fromEntries(Object.entries(localStorageContents).filter(([key, value]) => value["videos"]));

Check warning on line 58 in src/background.js

View workflow job for this annotation

GitHub Actions / CompatibilityTest

'key' is defined but never used

// Sort the playlists by lastAccessedLocally value
const sortedPlaylists = Object.entries(allPlaylists).sort((a, b) => {
Expand All @@ -63,7 +64,7 @@

// Remove the 20% of playlists that have not been accessed the longest
const playlistsToRemove = sortedPlaylists.slice(Math.floor(sortedPlaylists.length * 0.8));
for (const [playlistId, playlistInfo] of playlistsToRemove) {

Check warning on line 67 in src/background.js

View workflow job for this annotation

GitHub Actions / CompatibilityTest

'playlistInfo' is assigned a value but never used
console.log(`Removing playlist ${playlistId} from local storage...`, true);
chrome.storage.local.remove(playlistId);
}
Expand Down Expand Up @@ -114,7 +115,7 @@
let configSyncValues = await chrome.storage.sync.get();

// For each object entry in channelSettings that has the "shufflePercentage" item, rename it to "percentageValue" and add a new key "activeOption": "percentageOption"
for (const [channelID, channelSetting] of Object.entries(configSyncValues["channelSettings"])) {

Check warning on line 118 in src/background.js

View workflow job for this annotation

GitHub Actions / CompatibilityTest

'channelID' is assigned a value but never used
if (channelSetting["shufflePercentage"]) {
channelSetting["percentageValue"] = channelSetting["shufflePercentage"];
channelSetting["activeOption"] = "percentageOption";
Expand Down Expand Up @@ -212,7 +213,7 @@
// ---------- Firebase ----------
// Interact with Firestore and get the latest news
// createdAt is a custom field
async function checkForAndShowNews() {

Check warning on line 216 in src/background.js

View workflow job for this annotation

GitHub Actions / CompatibilityTest

'checkForAndShowNews' is defined but never used
if (configSync.nextNewsCheckTime >= Date.now()) {
console.log(`Skipping news check until ${new Date(configSync.nextNewsCheckTime).toLocaleString()}`);
return;
Expand Down Expand Up @@ -263,7 +264,7 @@
} else {
console.log("Updating playlistInfo in the database...");
// Contains all properties except the videos
const playlistInfoWithoutVideos = Object.fromEntries(Object.entries(playlistInfo).filter(([key, value]) => (key !== "videos")));

Check warning on line 267 in src/background.js

View workflow job for this annotation

GitHub Actions / CompatibilityTest

'value' is defined but never used

// Upload the 'metadata'
update(ref(firebase, playlistId), playlistInfoWithoutVideos);
Expand Down
4 changes: 2 additions & 2 deletions static/manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "Random YouTube Video",
"description": "Customize, shuffle and play random videos from any YouTube channel.",
"version": "3.1.8",
"version_name": "3.1.8",
"version": "3.1.9",
"version_name": "3.1.9",
"manifest_version": 3,
"content_scripts": [
{
Expand Down
Loading