A decentralized music tracking and discovery platform built on AT Protocol 🎵 rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz

[api] use parentAlias

+10 -19
+5 -8
apps/api/src/xrpc/app/rocksky/dropbox/getFiles.ts
··· 77 77 .select() 78 78 .from(tables.dropboxPaths) 79 79 .leftJoin( 80 - tables.dropboxDirectories, 81 - eq(tables.dropboxDirectories.id, tables.dropboxPaths.directoryId) 80 + parentAlias, 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 - tables.dropboxDirectories.path, 93 + parentAlias.path, 94 94 _.get(params, "at", "/Music").replace(/\/$/, "").trim() 95 95 ), 96 - eq( 97 - tables.dropboxDirectories.fileId, 98 - _.get(params, "at", "").trim() 99 - ) 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 - _.get(data, "0.0.parent", null) 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 - tables.googleDriveDirectories, 86 - eq( 87 - tables.googleDrivePaths.directoryId, 88 - tables.googleDriveDirectories.id 89 - ) 85 + parentAlias, 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 - tables.googleDriveDirectories.path, 101 + parentAlias.path, 105 102 _.get(params, "at", "/Music").replace(/\/$/, "").trim() 106 103 ), 107 - eq( 108 - tables.googleDriveDirectories.fileId, 109 - _.get(params, "at", "").trim() 110 - ) 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 - _.get(data, "0.0.parent", null) 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,