Skip to content

Commit

Permalink
Release 4.22.0 - May 9th, 2021
Browse files Browse the repository at this point in the history
  • Loading branch information
jiri-janousek committed May 9, 2021
2 parents 96d9bdb + 4429530 commit cff8d27
Show file tree
Hide file tree
Showing 8 changed files with 176 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Expand Up @@ -3,7 +3,7 @@ version: 2.1
executors:
fedora:
docker:
- image: fedora:32
- image: fedora:33
auth:
username: $DOCKER_USERNAME
password: $DOCKER_PASSWORD
Expand Down Expand Up @@ -185,9 +185,9 @@ jobs:
- checkout-nuvola
- install-common-deps
- build-vala:
branch: "0.50"
branch: "0.52"
- build-valalint:
branch: "0.50.x"
branch: "0.52.x"
- build-diorite
- build-nuvola-strict

Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,30 @@ Nuvola Player Changelog
[Nuvola Devel mailing list](https://groups.google.com/d/forum/nuvola-player-devel)
to receive more technical announcements and important information about future development.

Release 4.22.0 - May 9th, 2021
------------------------------

This is a concise changelog. Refer to [Nuvola News](https://medium.com/nuvola-news) for a more verbose one and to see
some screenshots.

### What’s New for Users

* New script: Airsonic (Maintainer: Jiří Janoušek)

* Deezer script 3.5: Fix Google sign-in. [[GitHub ticket](https://github.com/tiliado/nuvolaplayer/issues/726)]

* iHeartRADIO 1.1: Fix incompatibility of the old web engine by adding a polyfill for Promise.allSettled.
[[GitHub ticket](https://github.com/tiliado/nuvolaplayer/issues/727)]
Update metadata parsing.

* Spotify script 3.5: Fix artist parsing on the artist page.
[[GitHub ticket](https://github.com/tiliado/nuvolaplayer/issues/723)]
Fix wrong parsing of track length that caused excessive notifications.
[[GitHub ticket](https://github.com/tiliado/nuvolaplayer/issues/725)]

* Apple Music script 1.2: Deprecated until Nuvola Player upgrades its web engine.
[[GitHub ticket](https://github.com/tiliado/nuvolaplayer/issues/730)]

Release 4.21.0 - April 11th, 2021
---------------------------------

Expand Down
10 changes: 9 additions & 1 deletion src/mainjs/mediaplayer.js
Expand Up @@ -603,7 +603,15 @@ MediaPlayer._updateNotification = function () {
if (this._notification && track.title) {
const title = track.title
let message
if (!track.artist && !track.album) { message = 'by unknown artist' } else if (!track.artist) { message = Nuvola.format('from {1}', track.album) } else if (!track.album) { message = Nuvola.format('by {1}', track.artist) } else { message = Nuvola.format('by {1} from {2}', track.artist, track.album) }
if (!track.artist && !track.album) {
message = 'by unknown artist'
} else if (!track.artist) {
message = Nuvola.format('from {1}', track.album)
} else if (!track.album) {
message = Nuvola.format('by {1}', track.artist)
} else {
message = Nuvola.format('by {1} from {2}', track.artist, track.album)
}

this._notification.update(title, message, this._artworkFile ? null : 'nuvolaplayer', this._artworkFile)
this._showNotification()
Expand Down
43 changes: 32 additions & 11 deletions src/nuvolakit-runner/AppRunnerController.vala
Expand Up @@ -62,6 +62,7 @@ public class AppRunnerController: Drtgtk.Application {
private PreferencesDialog? preferences_dialog = null;
private StartupPhase startup_phase = StartupPhase.NONE;
private uint setup_sidebar_timeout_id = 0;
private TiliadoSurvey survey;

public AppRunnerController(
Drt.Storage storage, WebApp web_app, WebAppStorage app_storage) {
Expand All @@ -73,6 +74,7 @@ public class AppRunnerController: Drtgtk.Application {
this.version = "%d.%d".printf(web_app.version_major, web_app.version_minor);
this.app_storage = app_storage;
this.info_bars = new HashTable<string, Gtk.InfoBar>(str_hash, str_equal);
this.survey = new TiliadoSurvey(null, "nuvola2021/");
}

public signal void info_bar_response(string id, int reponse_id);
Expand Down Expand Up @@ -200,15 +202,9 @@ public class AppRunnerController: Drtgtk.Application {
about_dialog.close();
}

if (!config.get_bool("infobar.feature_voting_closed")) {
show_info_bar(
"feature-voting",
Gtk.MessageType.INFO,
"<b>Nuvola users are going to vote for feature requests in May 2021.</b>\n"
+ "We need your help to find out which feature requests are most wanted or not relevant anymore. "
+ "You can propose new features or improve existing requests.",
{"More information"}
);
if (tiliado_paywall != null) {
update_survey();
tiliado_paywall.tier_info_updated.connect(update_survey);
}
}

Expand Down Expand Up @@ -410,6 +406,7 @@ public class AppRunnerController: Drtgtk.Application {

private void load_app() {
set_app_menu_items({
Actions.SURVEY,
Actions.PREFERENCES, Actions.REPORT_BUG, Actions.ASK_QUESTION, Actions.REQUEST_FEATURE,
Actions.HELP, Actions.NEWS, Actions.ABOUT, Actions.QUIT});
main_window.set_menu_button_items({
Expand All @@ -436,6 +433,7 @@ public class AppRunnerController: Drtgtk.Application {
private void append_actions() {
unowned ActionsHelper ah = actions_helper;
Drtgtk.Action[] actions_spec = {
ah.simple_action("main", "app", Actions.SURVEY, "Nuvola Survey 2021", null, null, null, do_open_survey),
ah.simple_action("main", "app", Actions.PREFERENCES, "Preferences", "_Preferences", null, null, do_preferences),
ah.toggle_action("main", "win", Actions.TOGGLE_SIDEBAR, "Show sidebar", "Show _sidebar", null, null, do_toggle_sidebar, false),
ah.simple_action("go", "app", Actions.GO_HOME, "Home", "_Home", "go-home", "<alt>Home", web_engine.go_home),
Expand Down Expand Up @@ -569,6 +567,29 @@ public class AppRunnerController: Drtgtk.Application {
preferences_dialog = null;
}

private void do_open_survey() {
show_uri(survey.get_survey_url() ?? TiliadoSurvey.INFO_URL);
}

private void update_survey() {
TiliadoLicense? license = tiliado_paywall.get_gumroad_license();
if (license == null || !license.is_valid()) {
survey.survey_key = null;
} else {
survey.survey_key = license.license.license_key;

if (!config.get_bool("infobar.survey_2021_closed")) {
show_info_bar(
"feature-voting",
Gtk.MessageType.INFO,
"<b>You may participate in Nuvola Player Survey 2021.</b>\nWe need your help "
+ "to obtain the valuable insight we can use to shape the future of the project.",
{"Open survey"}
);
}
}
}

private void do_about() {
if (about_dialog == null) {
about_dialog = new AboutDialog(
Expand Down Expand Up @@ -786,10 +807,10 @@ public class AppRunnerController: Drtgtk.Application {
case "feature-voting":
switch (response) {
case 0:
show_uri("https://github.com/tiliado/nuvolaplayer/issues/678");
do_open_survey();
break;
case Gtk.ResponseType.CLOSE:
config.set_bool("infobar.feature_voting_closed", true);
config.set_bool("infobar.survey_2021_closed", true);
break;
}
break;
Expand Down
1 change: 1 addition & 0 deletions src/nuvolakit-runner/core/Actions.vala
Expand Up @@ -42,5 +42,6 @@ public const string ZOOM_IN = "zoom-in";
public const string ZOOM_OUT = "zoom-out";
public const string ZOOM_RESET = "zoom-reset";
public const string QUIT = "quit";
public const string SURVEY = "open-survey";

} // namespace Nuvola.Actions
64 changes: 64 additions & 0 deletions src/nuvolakit-runner/tiliado/TiliadoSurvey.vala
@@ -0,0 +1,64 @@
/*
* Copyright 2021 Jiří Janoušek <janousek.jiri@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

namespace Nuvola {

public class TiliadoSurvey: GLib.Object {
public const string DEFAULT_URL_TEMPLATE = "https://survey.tiliado.eu/%s/%s/";
public const string INFO_URL = "https://github.com/tiliado/nuvolaplayer/issues/678";
public string? survey_key = null;
private string url_template;
private string survey_id;

public TiliadoSurvey(string? url_template, string survey_id, string? survey_key = null) {
this.url_template = url_template ?? DEFAULT_URL_TEMPLATE;
this.survey_id = survey_id;
this.survey_key = survey_key;
}

public string? get_survey_url() {
if (Drt.String.is_empty(survey_key)) {
return null;
}
string? code = TiliadoSurvey.create_survey_code(survey_key);
return code == null ? null : url_template.printf(survey_id, code);
}

public static string? create_survey_code(string key) {
var s = new StringBuilder.sized(key.length);
unichar c;
for (int i = 0; key.get_next_char(ref i, out c);) {
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')) {
s.append_unichar(c);
}
}
if (s.len == 0) {
return null;
}

return GLib.Checksum.compute_for_string(GLib.ChecksumType.SHA256, s.str.down());
}
}

} // namespace Nuvola
42 changes: 42 additions & 0 deletions src/tests/TiliadoSurveyTest.vala
@@ -0,0 +1,42 @@
/*
* Author: Jiří Janoušek <janousek.jiri@gmail.com>
*
* To the extent possible under law, author has waived all
* copyright and related or neighboring rights to this file.
* http://creativecommons.org/publicdomain/zero/1.0/
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Tests are under public domain because they might contain useful sample code.
*/

namespace Nuvola {

public class TiliadoSurveyTest: Drt.TestCase {
const string SURVEY_CODE = "5e50f405ace6cbdf17379f4b9f2b0c9f4144c5e380ea0b9298cb02ebd8ffe511";

public void test_create_survey_code_ok() {
(unowned string)[] keys = {"my-key", "mY-Key", "MY-KEY", " my-key\t", "my🐛key"};
foreach (unowned string key in keys) {
expect_str_equal(SURVEY_CODE, TiliadoSurvey.create_survey_code(key), @"`$key`");
}
}

public void test_create_survey_code_fail() {
(unowned string)[] keys = {"", " ", "\t", "...", "č-á-é", "🐛"};
foreach (unowned string key in keys) {
expect_null(TiliadoSurvey.create_survey_code(key), @"`$key`");
}
}
}

} // namespace Nuvola
2 changes: 1 addition & 1 deletion wscript
Expand Up @@ -37,7 +37,7 @@ BLURB = "Tight integration of web-based media streaming services with your Linux
DEFAULT_HELP_URL = "https://github.com/tiliado/nuvolaruntime/wiki/Third-Party-Builds"
DEFAULT_WEB_APP_REQUIREMENTS_HELP_URL = DEFAULT_HELP_URL

MIN_DIORITE = "4.21.0"
MIN_DIORITE = "4.22.0"
MIN_VALA = "0.48.0"
MIN_GLIB = "2.56.1"
MIN_GTK = "3.22.30"
Expand Down

0 comments on commit cff8d27

Please sign in to comment.