Skip to content
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

Do not open the news page on version update #315

Merged
merged 2 commits into from
Jul 23, 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,11 +1,15 @@
# Changelog

## v3.1.9
## v3.1.10

<!--Releasenotes start-->
- Temporarily disabled the news feature.
- News page will no longer open after updating from v3.1.5 or an earlier version.
<!--Releasenotes end-->

## v3.1.9

- Temporarily disabled the news feature.

## v3.1.8

- The button's tooltip may now show additional information on the shuffle status.
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.9",
"version": "3.1.10",
"description": "Customize, shuffle and play random videos from any YouTube channel.",
"scripts": {
"dev": "concurrently \"npm run dev:chromium\" \"npm run dev:firefox\"",
Expand Down
5 changes: 0 additions & 5 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,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 @@ -64,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 @@ -92,11 +92,6 @@
}

async function handleVersionSpecificUpdates(previousVersion) {
// v3.1.5 added a notice for people using playlists
if (previousVersion < "3.1.5") {
await chrome.tabs.create({ url: chrome.runtime.getURL("html/breakingNews.html") });
}

// v3.0.1 changed the data type for the shuffleIgnoreShortsOption from boolean to number
if (previousVersion < "3.0.1") {
console.log("Updating sync storage to v3.0.1 format...", true);
Expand All @@ -115,7 +110,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 113 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 @@ -213,7 +208,7 @@
// ---------- Firebase ----------
// Interact with Firestore and get the latest news
// createdAt is a custom field
async function checkForAndShowNews() {

Check warning on line 211 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 @@ -264,7 +259,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 262 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.9",
"version_name": "3.1.9",
"version": "3.1.10",
"version_name": "3.1.10",
"manifest_version": 3,
"content_scripts": [
{
Expand Down
Loading