Skip to content

Commit 7e84c3b

Browse files
committed
[+] v1.3.1
1 parent 4307dfa commit 7e84c3b

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

.github/workflows/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: GitHub Actions
22
on: [push]
3+
4+
permissions:
5+
contents: write
6+
37
jobs:
48
action-run:
59
runs-on: ubuntu-latest

lib/models/player_controller.dart

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,7 @@ class PlayerController extends GetxController {
106106
fit: BoxFit.cover,
107107
);
108108
} else {
109-
try {
110-
return Image.file(File(path), fit: BoxFit.cover);
111-
} catch (_) {
112-
return Image.asset(
113-
Albums.random(),
114-
fit: BoxFit.cover,
115-
);
116-
}
109+
return Image.file(File(path), fit: BoxFit.cover);
117110
}
118111
}
119112

lib/models/playlist_controller.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,7 @@ class PlaylistController extends GetxController {
275275
var albumArtImagePath =
276276
(await findController.getDownloadsPicDirectoryWithoutCreate()) +
277277
"/" +
278-
trackName +
279-
"_" +
280-
artistName +
278+
basenameWithoutExtension(item.name) +
281279
".jpg";
282280

283281
Logger().d("${albumArtImagePath}");

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1616
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
1717
# In Windows, build-name is used as the major, minor, and patch parts
1818
# of the product and file versions while build-number is used as the build suffix.
19-
version: 1.1.3
19+
version: 1.3.1
2020

2121
environment:
2222
sdk: '>=3.3.4 <4.0.0'

rust/src/api/bilibili.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ use tokio::{
1111
sync::mpsc::{self, error::TrySendError},
1212
};
1313

14+
const DEFAULT_ALBUM_ART_IMAGE: &[u8] = include_bytes!("../../../assets/images/album_none.png");
15+
1416
pub mod bilibili {
1517
use super::*;
1618
use anyhow::Result;
@@ -285,7 +287,11 @@ pub async fn bv_video_info(bvid: String) -> Result<InfoData> {
285287
// 下载封面图
286288
pub async fn bv_download_pic(url: String, download_path: String) -> Result<()> {
287289
let client = bilibili::Client::new()?;
288-
let data = client.request_pic(url).await?;
290+
let data = client
291+
.request_pic(url)
292+
.await
293+
.unwrap_or(Vec::from(DEFAULT_ALBUM_ART_IMAGE));
294+
289295
let mut file = fs::File::create(Path::new(&download_path)).await?;
290296
file.write_all(&data).await?;
291297
Ok(())

0 commit comments

Comments
 (0)