put user agent in one place

This commit is contained in:
psykose 2024-10-15 23:16:43 +02:00
parent c66149b9c0
commit e3a25e2429
4 changed files with 6 additions and 2 deletions

View file

@ -142,7 +142,7 @@ public class Subsonic : Object {
this.parameters = @"u=$(Uri.escape_string(username))&t=$(Uri.escape_string(token))&s=$(Uri.escape_string(salt))&v=1.16.1&c=eu.callcc.audrey";
this.session = new Soup.Session ();
this.session.user_agent = "audrey/linux";
this.session.user_agent = Audrey.Const.user_agent;
this.artist_list = new ListStore (typeof (Artist));
this.album_list = new ListStore (typeof (Album));

3
src/globalconf.vala Normal file
View file

@ -0,0 +1,3 @@
namespace Audrey.Const {
public const string user_agent = "audrey/linux";
}

View file

@ -1,6 +1,7 @@
audrey_sources = [
'api.vala',
'application.vala',
'globalconf.vala',
'main.vala',
'mpris.vala',
'playbin.vala',

View file

@ -41,7 +41,7 @@ class Playbin : Object {
private bool next_gapless;
private void source_setup (Gst.Element playbin, dynamic Gst.Element source) {
source.user_agent = "audrey/linux";
source.user_agent = Audrey.Const.user_agent;
}
// ASSUMPTION: about-to-finish will be signalled exactly once per track