Skip to content

Support all item.type #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

pencilheart
Copy link
Contributor

Support all item.type via change const authors = creators.filter((creator) => creator.creatorTypeID === 8,) to const creators = item.getCreators()

fixed #114

@jstzwj
Copy link
Collaborator

jstzwj commented Apr 23, 2025

I think that if you want to extend to other document types, you should consider each ItemType individually and design rules for which CreatorTypes should be treated as the author for each ItemType, rather than directly retrieving all creators.

Reference:

type ItemTypeMapping = {
      1: "annotation";
      2: "artwork";
      3: "attachment";
      4: "audioRecording";
      5: "bill";
      6: "blogPost";
      7: "book";
      8: "bookSection";
      9: "case";
      10: "computerProgram";
      11: "conferencePaper";
      12: "dictionaryEntry";
      13: "document";
      14: "email";
      15: "encyclopediaArticle";
      16: "film";
      17: "forumPost";
      18: "hearing";
      19: "instantMessage";
      20: "interview";
      21: "journalArticle";
      22: "letter";
      23: "magazineArticle";
      24: "manuscript";
      25: "map";
      26: "newspaperArticle";
      27: "note";
      28: "patent";
      29: "podcast";
      30: "preprint";
      31: "presentation";
      32: "radioBroadcast";
      33: "report";
      34: "statute";
      35: "thesis";
      36: "tvBroadcast";
      37: "videoRecording";
      38: "webpage";
      39: "dataset";
      40: "standard";
    };
 type CreatorTypeMapping = { 
      1: "artist";
      2: "contributor";
      3: "performer";
      4: "composer";
      5: "wordsBy";
      6: "sponsor";
      7: "cosponsor";
      8: "author";
      9: "commenter";
      10: "editor";
      11: "translator";
      12: "seriesEditor";
      13: "bookAuthor";
      14: "counsel";
      15: "programmer";
      16: "reviewedAuthor";
      17: "recipient";
      18: "director";
      19: "scriptwriter";
      20: "producer";
      21: "interviewee";
      22: "interviewer";
      23: "cartographer";
      24: "inventor";
      25: "attorneyAgent";
      26: "podcaster";
      27: "guest";
      28: "presenter";
      29: "castMember";
    };

let lastAuthorDisplayed: string = "";

if (itemType === "thesis") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Design CreatorType filtering rules for different ItemTypes.

@jstzwj jstzwj added good first issue Good for newcomers working on it H~o~l~d my beer labels Apr 23, 2025
@pencilheart
Copy link
Contributor Author

I don't think so. It is enough for this add-on.

If there are errors in some items, you can list them here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers working on it H~o~l~d my beer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

专利类型的发明人首位作者显示可能有问题
2 participants