tangled
alpha
login
or
join now
rocksky.app
/
rocksky
96
fork
atom
A decentralized music tracking and discovery platform built on AT Protocol 🎵
rocksky.app
spotify
atproto
lastfm
musicbrainz
scrobbling
listenbrainz
96
fork
atom
overview
issues
7
pulls
pipelines
[api] use parentAlias
tsiry-sandratraina.com
8 months ago
d0a194a1
9b21ce5f
+10
-19
2 changed files
expand all
collapse all
unified
split
apps
api
src
xrpc
app
rocksky
dropbox
getFiles.ts
googledrive
getFiles.ts
+5
-8
apps/api/src/xrpc/app/rocksky/dropbox/getFiles.ts
···
77
77
.select()
78
78
.from(tables.dropboxPaths)
79
79
.leftJoin(
80
80
-
tables.dropboxDirectories,
81
81
-
eq(tables.dropboxDirectories.id, tables.dropboxPaths.directoryId)
80
80
+
parentAlias,
81
81
+
eq(parentAlias.id, tables.dropboxPaths.directoryId)
82
82
)
83
83
.leftJoin(
84
84
tables.dropbox,
···
90
90
eq(tables.users.did, did),
91
91
or(
92
92
eq(
93
93
-
tables.dropboxDirectories.path,
93
93
+
parentAlias.path,
94
94
_.get(params, "at", "/Music").replace(/\/$/, "").trim()
95
95
),
96
96
-
eq(
97
97
-
tables.dropboxDirectories.fileId,
98
98
-
_.get(params, "at", "").trim()
99
99
-
)
96
96
+
eq(parentAlias.fileId, _.get(params, "at", "").trim())
100
97
)
101
98
)
102
99
)
···
115
112
return Effect.sync(() => ({
116
113
parentDirectory: R.omit(
117
114
["createdAt", "updatedAt"],
118
118
-
_.get(data, "0.0.parent", null)
115
115
+
_.get(data, "0.0.parent", null) || _.get(data, "1.0.parent", null)
119
116
),
120
117
directories: data[0].map((item) => ({
121
118
id: item.dropbox_directories.id,
+5
-11
apps/api/src/xrpc/app/rocksky/googledrive/getFiles.ts
···
82
82
.select()
83
83
.from(tables.googleDrivePaths)
84
84
.leftJoin(
85
85
-
tables.googleDriveDirectories,
86
86
-
eq(
87
87
-
tables.googleDrivePaths.directoryId,
88
88
-
tables.googleDriveDirectories.id
89
89
-
)
85
85
+
parentAlias,
86
86
+
eq(tables.googleDrivePaths.directoryId, parentAlias.id)
90
87
)
91
88
.leftJoin(
92
89
tables.googleDrive,
···
101
98
eq(tables.users.did, did),
102
99
or(
103
100
eq(
104
104
-
tables.googleDriveDirectories.path,
101
101
+
parentAlias.path,
105
102
_.get(params, "at", "/Music").replace(/\/$/, "").trim()
106
103
),
107
107
-
eq(
108
108
-
tables.googleDriveDirectories.fileId,
109
109
-
_.get(params, "at", "").trim()
110
110
-
)
104
104
+
eq(parentAlias.fileId, _.get(params, "at", "").trim())
111
105
)
112
106
)
113
107
)
···
126
120
return Effect.sync(() => ({
127
121
parentDirectory: R.omit(
128
122
["createdAt", "updatedAt"],
129
129
-
_.get(data, "0.0.parent", null)
123
123
+
_.get(data, "0.0.parent", null) || _.get(data, "1.0.parent", null)
130
124
),
131
125
directories: data[0].map((item) => ({
132
126
id: item.google_drive_directories.id,