Commit 969cb64
refactor: replace GroupMediaDownload with RsGroupDownload from shared interfaces
BREAKING CHANGE: The /libraries/:id/medias/download endpoint now expects
RsGroupDownload instead of GroupMediaDownload<MediaDownloadUrl>.
## What changed
- Removed `GroupMediaDownload<T>` and `MediaDownloadUrl` structs
- Now uses `RsGroupDownload` and `RsRequest` from rs-plugin-common-interfaces
- Added new lookup fields: `tags_lookup`, `people_lookup`, `albums_lookup`
(separate from direct ID fields `tags`, `people`, `albums`)
- Bumped rs-plugin-common-interfaces to 0.20.4
## Migration Guide
### Before (TypeScript)
```typescript
interface MediaDownloadUrl {
url: string;
parse: boolean;
uploadId?: string;
ignoreOriginDuplicate?: boolean;
kind?: 'photo' | 'video' | 'archive' | 'album' | 'other';
filename?: string;
mime?: string;
description?: string;
length?: number;
thumbnailUrl?: string;
peopleLookup?: string[];
seriesLookup?: string[];
tagsLookup?: string[];
season?: number;
episode?: number;
}
interface GroupMediaDownload {
group?: boolean;
groupThumbnailUrl?: string;
groupFilename?: string;
groupMime?: string;
files: MediaDownloadUrl[];
referer?: string;
headers?: string[]; // "Name:Value" format
cookies?: string[];
originUrl?: string;
title?: string;
ignoreOriginDuplicate?: boolean;
description?: string;
peopleLookup?: string[];
seriesLookup?: string[];
tagsLookup?: string[];
season?: number;
episode?: number;
}
// Old usage
const download: GroupMediaDownload = {
files: [{
url: 'https://example.com/image.jpg',
parse: false,
peopleLookup: ['John Doe'],
tagsLookup: ['vacation']
}],
originUrl: 'https://example.com/post/123'
};
```
### After (TypeScript)
```typescript
interface RsRequest {
url: string;
uploadId?: string;
mime?: string;
size?: number;
filename?: string;
status?: 'unprocessed' | 'needParsing' | 'finalPublic' | 'finalPrivate';
referer?: string;
headers?: [string, string][]; // Tuple array format
cookies?: RsCookie[];
description?: string;
ignoreOriginDuplicate?: boolean;
// New lookup fields (text to search in DB)
tagsLookup?: string[];
peopleLookup?: string[];
albumsLookup?: string[]; // renamed from seriesLookup
// New download fields
thumbnailUrl?: string;
originUrl?: string;
title?: string;
kind?: 'photo' | 'video' | 'archive' | 'album' | 'other';
season?: number;
episode?: number;
}
interface RsGroupDownload {
group: boolean; // Now required, not optional
groupThumbnailUrl?: string;
groupFilename?: string;
groupMime?: string;
requests: RsRequest[]; // renamed from 'files'
}
// New usage - info moved to individual requests
const download: RsGroupDownload = {
group: false,
requests: [{
url: 'https://example.com/image.jpg',
status: 'unprocessed', // replaces parse: false
peopleLookup: ['John Doe'],
tagsLookup: ['vacation'],
originUrl: 'https://example.com/post/123' // moved to request
}]
};
// For grouped downloads
const groupedDownload: RsGroupDownload = {
group: true,
groupFilename: 'my-album.zip',
groupThumbnailUrl: 'https://example.com/thumb.jpg',
requests: [
{ url: 'https://example.com/1.jpg', status: 'unprocessed' },
{ url: 'https://example.com/2.jpg', status: 'unprocessed' }
]
};
```
## Key differences
1. `files` renamed to `requests`
2. `parse: true` becomes `status: 'needParsing'`
3. `parse: false` becomes `status: 'unprocessed'`
4. `seriesLookup` renamed to `albumsLookup`
5. Group-level `originUrl`, `referer`, `headers`, `cookies` moved to individual requests
6. `headers` format changed from `["Name:Value"]` to `[["Name", "Value"]]`
7. `cookies` now uses structured `RsCookie` objects instead of strings
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 0e25a75 commit 969cb64
5 files changed
Lines changed: 60 additions & 203 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | 443 | | |
577 | 444 | | |
578 | 445 | | |
| |||
621 | 488 | | |
622 | 489 | | |
623 | 490 | | |
624 | | - | |
625 | 491 | | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
| 492 | + | |
640 | 493 | | |
641 | 494 | | |
642 | | - | |
| 495 | + | |
643 | 496 | | |
644 | 497 | | |
645 | 498 | | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | 499 | | |
677 | | - | |
678 | | - | |
679 | 500 | | |
680 | 501 | | |
681 | 502 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
183 | 205 | | |
184 | 206 | | |
185 | 207 | | |
| |||
655 | 677 | | |
656 | 678 | | |
657 | 679 | | |
658 | | - | |
| 680 | + | |
659 | 681 | | |
660 | 682 | | |
661 | 683 | | |
662 | 684 | | |
663 | 685 | | |
664 | 686 | | |
665 | 687 | | |
666 | | - | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
667 | 693 | | |
668 | 694 | | |
669 | 695 | | |
670 | 696 | | |
671 | 697 | | |
672 | 698 | | |
673 | | - | |
| 699 | + | |
674 | 700 | | |
675 | | - | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
676 | 714 | | |
677 | 715 | | |
678 | 716 | | |
679 | | - | |
| 717 | + | |
680 | 718 | | |
681 | 719 | | |
682 | 720 | | |
683 | 721 | | |
684 | 722 | | |
685 | 723 | | |
686 | 724 | | |
687 | | - | |
| 725 | + | |
688 | 726 | | |
689 | 727 | | |
690 | 728 | | |
| |||
771 | 809 | | |
772 | 810 | | |
773 | 811 | | |
774 | | - | |
| 812 | + | |
775 | 813 | | |
776 | 814 | | |
777 | 815 | | |
778 | 816 | | |
779 | 817 | | |
780 | 818 | | |
781 | 819 | | |
782 | | - | |
783 | | - | |
| 820 | + | |
| 821 | + | |
784 | 822 | | |
785 | 823 | | |
786 | | - | |
| 824 | + | |
787 | 825 | | |
788 | 826 | | |
789 | 827 | | |
| |||
819 | 857 | | |
820 | 858 | | |
821 | 859 | | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
| 860 | + | |
| 861 | + | |
826 | 862 | | |
827 | 863 | | |
828 | 864 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | | - | |
| 562 | + | |
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
| |||
0 commit comments