Skip to content

Commit 382368c

Browse files
committed
refactor: change track uri to url
1 parent 38b21db commit 382368c

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ interface Track {
127127
album: string; // Album name
128128
genre: string; // Music genre
129129
duration: number; // Duration in seconds
130-
uri: string; // File URI or path
130+
url: string; // File URL or path
131131
createdAt?: number; // Date added (Unix timestamp)
132132
modifiedAt?: number; // Date modified (Unix timestamp)
133133
fileSize?: number; // File size in bytes
@@ -186,7 +186,7 @@ const loadMusicLibrary = async () => {
186186
result.items.forEach(track => {
187187
console.log(`${track.title} by ${track.artist}`);
188188
console.log(`Duration: ${Math.floor(track.duration / 60)}:${track.duration % 60}`);
189-
console.log(`File: ${track.uri}`);
189+
console.log(`File: ${track.url}`);
190190
});
191191
} catch (error) {
192192
console.error('Failed to load music library:', error);

README_ZH.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ interface Track {
127127
album: string; // 专辑名称
128128
genre: string; // 音乐类型
129129
duration: number; // 持续时间(秒)
130-
uri: string; // 文件 URI 或路径
130+
url: string; // 文件 URL 或路径
131131
createdAt?: number; // 添加日期(Unix 时间戳)
132132
modifiedAt?: number; // 修改日期(Unix 时间戳)
133133
fileSize?: number; // 文件大小(字节)
@@ -186,7 +186,7 @@ const loadMusicLibrary = async () => {
186186
result.items.forEach(track => {
187187
console.log(`${track.title} - ${track.artist}`);
188188
console.log(`时长: ${Math.floor(track.duration / 60)}:${track.duration % 60}`);
189-
console.log(`文件: ${track.uri}`);
189+
console.log(`文件: ${track.url}`);
190190
});
191191
} catch (error) {
192192
console.error('加载音乐库失败:', error);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ data class Track(
88
val album: String,
99
val genre: String,
1010
val duration: Double,
11-
val uri: String,
11+
val url: String,
1212
val createdAt: Long? = null,
1313
val modifiedAt: Long? = null,
1414
val fileSize: Long,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ object GetTracksQuery {
105105
album = album,
106106
genre = genre,
107107
duration = duration,
108-
uri = "file://$data",
108+
url = "file://$data",
109109
createdAt = dateAdded * 1000, // Convert to milliseconds
110110
modifiedAt = dateAdded * 1000, // Convert to milliseconds
111111
fileSize = fileSize

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ object DataConverter {
1515
map.putString("album", track.album)
1616
map.putString("genre", track.genre)
1717
map.putDouble("duration", track.duration)
18-
map.putString("uri", track.uri)
18+
map.putString("url", track.url)
1919
map.putLong("fileSize", track.fileSize)
2020

2121
track.createdAt?.let { map.putDouble("createdAt", it.toDouble()) }

0 commit comments

Comments
 (0)