From c76418d26f1a5f52f5cb1e46951f1cf6726508c2 Mon Sep 17 00:00:00 2001 From: Jagandeep Brar Date: Fri, 23 Sep 2022 23:25:02 -0400 Subject: [PATCH] feat(lidarr): add MusicBrainz to links --- assets/LunaBrandIcons.ttf | Bin 5124 -> 5536 bytes assets/images/brands/config.json | 14 ++++++++++++++ assets/images/brands/musicbrainz.svg | 1 + lib/modules/lidarr/sheets/links.dart | 7 +++++++ lib/utils/links.dart | 7 +++++++ lib/widgets/ui/icons/icon.dart | 1 + 6 files changed, 30 insertions(+) create mode 100644 assets/images/brands/musicbrainz.svg diff --git a/assets/LunaBrandIcons.ttf b/assets/LunaBrandIcons.ttf index 3328a5de912b04d768fe137f003202a5eacf0a6c..edbddedbfe533aea8cb623e59aa4e07681ee6524 100644 GIT binary patch delta 974 zcmYLGJ!n%=6h7zNpZA--Bri?lPuessjas1^HE}3y!9{Rz5fKL^+SnGFw4}9YmpGIv zqN2u42f;;LD%3^jBqE)MZnppy>( z_aCkGjXHoFGBPhd{krT8{{}|{tiacE2k!p&JC8&l4ly@@LX|D7b6VZF`IuzOCBL~G zNdUJ%MA2dPHs>vagmawiM#VBvfgQMk7xeDz05CI{bp*MP?HY2n3rSun){ut^?xH}0 z!CkDVuinj$g4PQCXuT%Kb0d1^->%(yDGE)CCo#AO1bn6t+zkTG4Z(dO=xBo{K;X5( zvmnT|!BZjVZ6ll?*#kU}?`cV-#do=(#?(E%9`@zyy3Nk#cTY@tmfjy>H1wUphq=Tm124Jr2OY|ONr zGO6hV<{y_pXk-is=nCz=pW_Z F_!k;;n^XV* delta 525 zcmYjNO-mb56g_v|WRjVrlkuy#kP@k&)gbLgTm(OMg)ZE=5JaXrHHF03F-Vj`x)4zi zQ39@9xKfZ(C~@ghT=^TMi!R=(xKMD_cxKYl-p84D&zXD9g?BQtHFWU0{^|bu0x&W} zYPq!W;qiQC8!+=g#w!N?Qf}d>2H*!VR-}+DsCo96#6YoJtqpqYAV2vTDpeN!?C(tE z? \ No newline at end of file diff --git a/lib/modules/lidarr/sheets/links.dart b/lib/modules/lidarr/sheets/links.dart index 69ddfb5ae..122f48d80 100644 --- a/lib/modules/lidarr/sheets/links.dart +++ b/lib/modules/lidarr/sheets/links.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:lunasea/extensions/string/links.dart'; import 'package:lunasea/modules/lidarr/core/api.dart'; +import 'package:lunasea/utils/links.dart'; import 'package:lunasea/widgets/ui.dart'; class LinksSheet extends LunaBottomModalSheet { @@ -38,6 +39,12 @@ class LinksSheet extends LunaBottomModalSheet { leading: const LunaIconButton(icon: LunaIcons.LASTFM), onTap: artist.lastfmURI!.openLink, ), + LunaBlock( + title: 'MusicBrainz', + leading: const LunaIconButton(icon: LunaIcons.MUSICBRAINZ), + onTap: + LunaLinkedContent.musicBrainz(artist.foreignArtistID)!.openLink, + ), ], ); } diff --git a/lib/utils/links.dart b/lib/utils/links.dart index 2cd608aae..7e25d3288 100644 --- a/lib/utils/links.dart +++ b/lib/utils/links.dart @@ -40,6 +40,13 @@ enum LunaLinkedContent { return '$base/tmdb/$id'; } + static String? musicBrainz(String? id) { + if (id == null) return null; + String base = 'https://musicbrainz.org/artist'; + + return '$base/$id'; + } + static String? theMovieDB(dynamic id, LinkedContentType type) { if (id == null) return null; String base = 'https://www.themoviedb.org'; diff --git a/lib/widgets/ui/icons/icon.dart b/lib/widgets/ui/icons/icon.dart index 10c0f0bac..a177ab9dd 100644 --- a/lib/widgets/ui/icons/icon.dart +++ b/lib/widgets/ui/icons/icon.dart @@ -67,6 +67,7 @@ class LunaIcons { // Brands - Custom static const IconData LIDARR = IconData(0xe805, fontFamily: _fontFamily); + static const IconData MUSICBRAINZ = IconData(0xe809, fontFamily: _fontFamily); static const IconData NZBGET = IconData(0xe807, fontFamily: _fontFamily); static const IconData OVERSEERR = IconData(0xe808, fontFamily: _fontFamily); static const IconData RADARR = IconData(0xe80a, fontFamily: _fontFamily);