Skip to content

Commit 8c2e18a

Browse files
authored
Fixed version update not being handled correctly (#254)
1 parent 2e93157 commit 8c2e18a

File tree

6 files changed

+17
-11
lines changed

6 files changed

+17
-11
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# Changelog
22

3-
## v3.0.0
3+
## v3.0.1
44

55
<!--Releasenotes start-->
6+
- Fixed the old "Ignore shorts" option not being updated to the new format correctly.
7+
<!--Releasenotes end-->
8+
9+
## v3.0.0
10+
611
- Shorts pages are now supported! Shuffle buttons can now be found on all shorts pages.
712
- Added a new option to shuffle only from shorts.
813
- Added a 'welcome' page that will be shown when you first install the extension and guide you through the first steps.
@@ -14,7 +19,6 @@
1419
- The popup now feels smoother in some places, and will make it clearer when some inputs are invalid.
1520
- If certain errors are encountered, the playlist will still be saved locally and in the database, to speed up the next shuffle.
1621
- Fixed bugs that would prevent some initialization logic to run after the extension is updated.
17-
<!--Releasenotes end-->
1822

1923
## v2.3.0
2024

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Firefox:
3838
alt="View changelog"></a>
3939
</p>
4040

41-
Download the extension for: [Chrome/Chromium](https://chromewebstore.google.com/detail/random-youtube-video/kijgnjhogkjodpakfmhgleobifempckf) | [Edge](https://microsoftedge.microsoft.com/addons/detail/random-youtube-video/fccfflipicelkilpmgniblpoflkbhdbe) | [Firefox](https://addons.mozilla.org/en-GB/firefox/addon/random-youtube-video/)
41+
Download the extension for: [Chrome/Chromium](https://chromewebstore.google.com/detail/random-youtube-video/kijgnjhogkjodpakfmhgleobifempckf) | [Firefox](https://addons.mozilla.org/en-GB/firefox/addon/random-youtube-video/) | [Edge](https://microsoftedge.microsoft.com/addons/detail/random-youtube-video/fccfflipicelkilpmgniblpoflkbhdbe)
4242

4343
*The Chrome Web Store version can be installed on any Chromium-based browser, such as Edge, Brave, Opera and many more.*
4444

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "random-youtube-video",
3-
"version": "3.0.0",
3+
"version": "3.0.1",
44
"description": "Customize, shuffle and play random videos from any YouTube channel.",
55
"scripts": {
66
"dev": "concurrently \"npm run dev:chromium\" \"npm run dev:firefox\"",

src/background.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ async function initExtension() {
1212
await setSyncStorageValue("previousVersion", manifestData.version);
1313
const welcomeUrl = chrome.runtime.getURL("html/welcome.html");
1414
await chrome.tabs.create({ url: welcomeUrl });
15-
} else if (configSync.previousVersion < manifestData.version) {
15+
}
16+
// 3.0.0 introduced the previousVersion config value, so the update would not be handled correctly here
17+
if (configSync.previousVersion < manifestData.version || configSync.previousVersion === "3.0.0") {
1618
await handleExtensionUpdate(manifestData, configSync.previousVersion);
1719
}
1820

@@ -72,9 +74,9 @@ async function handleExtensionUpdate(manifestData, previousVersion) {
7274
}
7375

7476
async function handleVersionSpecificUpdates(previousVersion) {
75-
// v3.0.0 changed the data type for the shuffleIgnoreShortsOption from boolean to number
76-
if (previousVersion < "3.0.0") {
77-
console.log("Updating sync storage to v3.0.0 format...");
77+
// v3.0.1 changed the data type for the shuffleIgnoreShortsOption from boolean to number
78+
if (previousVersion < "3.0.1") {
79+
console.log("Updating sync storage to v3.0.1 format...");
7880
const syncStorageContents = await chrome.storage.sync.get();
7981
if (syncStorageContents["shuffleIgnoreShortsOption"] == true) {
8082
await setSyncStorageValue("shuffleIgnoreShortsOption", 2);

static/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Random YouTube Video",
33
"description": "Customize, shuffle and play random videos from any YouTube channel.",
4-
"version": "3.0.0",
4+
"version": "3.0.1",
55
"manifest_version": 3,
66
"content_scripts": [
77
{

0 commit comments

Comments
 (0)