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 .select() 78 .from(tables.dropboxPaths) 79 .leftJoin( 80 - tables.dropboxDirectories, 81 - eq(tables.dropboxDirectories.id, tables.dropboxPaths.directoryId) 82 ) 83 .leftJoin( 84 tables.dropbox, ··· 90 eq(tables.users.did, did), 91 or( 92 eq( 93 - tables.dropboxDirectories.path, 94 _.get(params, "at", "/Music").replace(/\/$/, "").trim() 95 ), 96 - eq( 97 - tables.dropboxDirectories.fileId, 98 - _.get(params, "at", "").trim() 99 - ) 100 ) 101 ) 102 ) ··· 115 return Effect.sync(() => ({ 116 parentDirectory: R.omit( 117 ["createdAt", "updatedAt"], 118 - _.get(data, "0.0.parent", null) 119 ), 120 directories: data[0].map((item) => ({ 121 id: item.dropbox_directories.id,
··· 77 .select() 78 .from(tables.dropboxPaths) 79 .leftJoin( 80 + parentAlias, 81 + eq(parentAlias.id, tables.dropboxPaths.directoryId) 82 ) 83 .leftJoin( 84 tables.dropbox, ··· 90 eq(tables.users.did, did), 91 or( 92 eq( 93 + parentAlias.path, 94 _.get(params, "at", "/Music").replace(/\/$/, "").trim() 95 ), 96 + eq(parentAlias.fileId, _.get(params, "at", "").trim()) 97 ) 98 ) 99 ) ··· 112 return Effect.sync(() => ({ 113 parentDirectory: R.omit( 114 ["createdAt", "updatedAt"], 115 + _.get(data, "0.0.parent", null) || _.get(data, "1.0.parent", null) 116 ), 117 directories: data[0].map((item) => ({ 118 id: item.dropbox_directories.id,
+5 -11
apps/api/src/xrpc/app/rocksky/googledrive/getFiles.ts
··· 82 .select() 83 .from(tables.googleDrivePaths) 84 .leftJoin( 85 - tables.googleDriveDirectories, 86 - eq( 87 - tables.googleDrivePaths.directoryId, 88 - tables.googleDriveDirectories.id 89 - ) 90 ) 91 .leftJoin( 92 tables.googleDrive, ··· 101 eq(tables.users.did, did), 102 or( 103 eq( 104 - tables.googleDriveDirectories.path, 105 _.get(params, "at", "/Music").replace(/\/$/, "").trim() 106 ), 107 - eq( 108 - tables.googleDriveDirectories.fileId, 109 - _.get(params, "at", "").trim() 110 - ) 111 ) 112 ) 113 ) ··· 126 return Effect.sync(() => ({ 127 parentDirectory: R.omit( 128 ["createdAt", "updatedAt"], 129 - _.get(data, "0.0.parent", null) 130 ), 131 directories: data[0].map((item) => ({ 132 id: item.google_drive_directories.id,
··· 82 .select() 83 .from(tables.googleDrivePaths) 84 .leftJoin( 85 + parentAlias, 86 + eq(tables.googleDrivePaths.directoryId, parentAlias.id) 87 ) 88 .leftJoin( 89 tables.googleDrive, ··· 98 eq(tables.users.did, did), 99 or( 100 eq( 101 + parentAlias.path, 102 _.get(params, "at", "/Music").replace(/\/$/, "").trim() 103 ), 104 + eq(parentAlias.fileId, _.get(params, "at", "").trim()) 105 ) 106 ) 107 ) ··· 120 return Effect.sync(() => ({ 121 parentDirectory: R.omit( 122 ["createdAt", "updatedAt"], 123 + _.get(data, "0.0.parent", null) || _.get(data, "1.0.parent", null) 124 ), 125 directories: data[0].map((item) => ({ 126 id: item.google_drive_directories.id,