A decentralized music tracking and discovery platform built on AT Protocol 🎵

[api] allow browsing dropbox/googledrive files by fileid

[api] allow browsing dropbox/googledrive files by fileid

[api] allow browsing dropbox/googledrive files by fileid

+32 -14
+16 -7
apps/api/src/xrpc/app/rocksky/dropbox/getFiles.ts
··· 1 1 import { HandlerAuth } from "@atproto/xrpc-server"; 2 2 import { Context } from "context"; 3 - import { and, asc, eq } from "drizzle-orm"; 3 + import { and, asc, eq, or } from "drizzle-orm"; 4 4 import { alias } from "drizzle-orm/pg-core"; 5 5 import { Effect, pipe } from "effect"; 6 6 import { Server } from "lexicon"; ··· 61 61 .where( 62 62 and( 63 63 eq(tables.users.did, did), 64 - eq( 65 - parentAlias.path, 66 - _.get(params, "at", "/Music").replace(/\/$/, "").trim() 64 + or( 65 + eq( 66 + parentAlias.path, 67 + _.get(params, "at", "/Music").replace(/\/$/, "").trim() 68 + ), 69 + eq(parentAlias.fileId, _.get(params, "at", "").trim()) 67 70 ) 68 71 ) 69 72 ) ··· 84 87 .where( 85 88 and( 86 89 eq(tables.users.did, did), 87 - eq( 88 - tables.dropboxDirectories.path, 89 - _.get(params, "at", "/Music").replace(/\/$/, "").trim() 90 + or( 91 + eq( 92 + tables.dropboxDirectories.path, 93 + _.get(params, "at", "/Music").replace(/\/$/, "").trim() 94 + ), 95 + eq( 96 + tables.dropboxDirectories.fileId, 97 + _.get(params, "at", "").trim() 98 + ) 90 99 ) 91 100 ) 92 101 )
+16 -7
apps/api/src/xrpc/app/rocksky/googledrive/getFiles.ts
··· 1 1 import { Context } from "context"; 2 - import { and, asc, eq } from "drizzle-orm"; 2 + import { and, asc, eq, or } from "drizzle-orm"; 3 3 import { alias } from "drizzle-orm/pg-core"; 4 4 import { Effect, pipe } from "effect"; 5 5 import { Server } from "lexicon"; ··· 66 66 .where( 67 67 and( 68 68 eq(tables.users.did, did), 69 - eq( 70 - parentAlias.path, 71 - _.get(params, "at", "/Music").replace(/\/$/, "").trim() 69 + or( 70 + eq( 71 + parentAlias.path, 72 + _.get(params, "at", "/Music").replace(/\/$/, "").trim() 73 + ), 74 + eq(parentAlias.fileId, _.get(params, "at", "").trim()) 72 75 ) 73 76 ) 74 77 ) ··· 95 98 .where( 96 99 and( 97 100 eq(tables.users.did, did), 98 - eq( 99 - tables.googleDriveDirectories.path, 100 - _.get(params, "at", "/Music").replace(/\/$/, "").trim() 101 + or( 102 + eq( 103 + tables.googleDriveDirectories.path, 104 + _.get(params, "at", "/Music").replace(/\/$/, "").trim() 105 + ), 106 + eq( 107 + tables.googleDriveDirectories.fileId, 108 + _.get(params, "at", "").trim() 109 + ) 101 110 ) 102 111 ) 103 112 )