mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 16:02:26 +00:00
Merge pull request #1139 from PR0M3TH3AN/improve-scalability-ux-15527506408449322934
Improve scalability limits and magnet upload UX
This commit is contained in:
2 files changed
+19
-2
No files matched your search
+5
-2
@@ -5856,11 +5856,14 @@ export class NostrClient {
|
||||
/**
|
||||
* fetchVideos => old approach
|
||||
*/
|
||||
async fetchVideos() {
|
||||
async fetchVideos(options = {}) {
|
||||
const requestedLimit = Number(options?.limit);
|
||||
const resolvedLimit = this.clampVideoRequestLimit(requestedLimit, DEFAULT_VIDEO_REQUEST_LIMIT);
|
||||
|
||||
const filter = {
|
||||
kinds: [30078],
|
||||
"#t": ["video"],
|
||||
limit: 300,
|
||||
limit: resolvedLimit,
|
||||
since: 0,
|
||||
};
|
||||
|
||||
|
||||
@@ -744,6 +744,20 @@ export class UploadModal {
|
||||
);
|
||||
}
|
||||
|
||||
const hasDirectUrl = typeof rawPayload.url === "string" && rawPayload.url.trim().length > 0;
|
||||
const hasMagnet = typeof rawPayload.magnet === "string" && rawPayload.magnet.trim().length > 0;
|
||||
|
||||
if (!hasDirectUrl && hasMagnet) {
|
||||
const confirmed = typeof window !== "undefined" && window.confirm
|
||||
? window.confirm("You are uploading with a magnet link only.\n\nSince this video is not hosted on a server, it will only be playable as long as you (or others) continue seeding it.\n\nDo you want to proceed?")
|
||||
: true;
|
||||
|
||||
if (!confirmed) {
|
||||
this.updateCustomSubmitButtonState();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const nip71Metadata = this.nip71FormManager.collectSection("custom");
|
||||
if (nip71Metadata) {
|
||||
rawPayload.nip71 = nip71Metadata;
|
||||
|
||||
Reference in new issue
Block a user