Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: some title of radio is html format, need to convert to human readable format #870

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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