Skip to content

Commit 57df945

Browse files
committed
refactor: rename cover field to artwork for better terminology
1 parent bd9898d commit 57df945

File tree

7 files changed

+8
-13
lines changed

7 files changed

+8
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ console.log('Has more:', customResult.hasNextPage);
112112
interface Track {
113113
id: string;
114114
title: string; // Track title
115-
cover: string; // Cover file URI
115+
artwork: string; // Artwork file URI
116116
artist: string; // Artist name
117117
album: string; // Album name
118118
genre: string; // Music genre

README_ZH.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ console.log('是否还有更多:', customResult.hasNextPage);
112112
interface Track {
113113
id: string;
114114
title: string; // 曲目标题
115-
cover: string; // 专辑封面 URI
115+
artwork: string; // 专辑封面 URI
116116
artist: string; // 艺术家名称
117117
album: string; // 专辑名称
118118
genre: string; // 音乐类型

android/src/main/java/com/musiclibrary/models/Assets.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
package com.musiclibrary.models
22

3-
data class TrackMeta(
4-
val cover: String,
5-
val genre: String
6-
)
7-
83
data class Track(
94
val id: String,
105
val title: String,
11-
val cover: String,
6+
val artwork: String,
127
val artist: String,
138
val album: String,
149
val genre: String,

android/src/main/java/com/musiclibrary/tracks/GetTracksQuery.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ object GetTracksQuery {
9595
val track = Track(
9696
id = id.toString(),
9797
title = title,
98-
cover = artworkUri.toString(),
98+
artwork = artworkUri.toString(),
9999
artist = artist,
100100
album = album,
101101
genre = genre,

android/src/main/java/com/musiclibrary/utils/DataConverter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ object DataConverter {
1010
val map = Arguments.createMap()
1111
map.putString("id", track.id)
1212
map.putString("title", track.title)
13-
map.putString("cover", track.cover)
13+
map.putString("artwork", track.artwork)
1414
map.putString("artist", track.artist)
1515
map.putString("album", track.album)
1616
map.putString("genre", track.genre)

example/src/TrackList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default function TrackList() {
6363

6464
const renderItem = ({ item }: { item: Track }) => (
6565
<View style={styles.trackItem}>
66-
<Image source={{ uri: item.cover }} style={styles.cover} />
66+
<Image source={{ uri: item.artwork }} style={styles.cover} />
6767
<View style={styles.trackInfo}>
6868
<Text style={styles.trackTitle} numberOfLines={1}>
6969
{item.title}

src/NativeMusicLibrary.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ export interface Track {
105105
*/
106106
title: string;
107107

108-
/** Track cover (file URI) */
109-
cover: string;
108+
/** Track artwork (file URI) */
109+
artwork: string;
110110

111111
/**
112112
* Artist name

0 commit comments

Comments
 (0)