Skip to content

Commit

Permalink
fix: some title of radio is html format, need to convert to human rea…
Browse files Browse the repository at this point in the history
…dable format (#870)

Fixes #866
  • Loading branch information
Feichtmeier authored Aug 19, 2024
1 parent 3795a21 commit 4c398e1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/player/player_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'dart:typed_data';

import 'package:audio_service/audio_service.dart';
import 'package:flutter/material.dart';
import 'package:html/parser.dart';
import 'package:media_kit/media_kit.dart' hide PlayerState;
import 'package:media_kit_video/media_kit_video.dart';
import 'package:palette_generator/palette_generator.dart';
Expand Down Expand Up @@ -295,7 +296,11 @@ class PlayerService {
return;
}
final mpvMetaData = MpvMetaData.fromJson(data);
setMpvMetaData(mpvMetaData);
setMpvMetaData(
mpvMetaData.copyWith(
icyTitle: HtmlParser(mpvMetaData.icyTitle).parseFragment().text,
),
);
final songInfo = mpvMetaData.icyTitle.splitByDash;
fetchAlbumArt(mpvMetaData.icyTitle).then(
(albumArt) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ packages:
source: hosted
version: "0.4.0"
html:
dependency: transitive
dependency: "direct main"
description:
name: html
sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a"
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies:
github: ^9.24.0
gtk: ^2.1.0
handy_window: ^0.4.0
html: ^0.15.4
http: ^1.2.1
intl: ^0.18.0
m3u_parser_nullsafe: ^1.0.3
Expand Down

0 comments on commit 4c398e1

Please sign in to comment.