Replies: 3 comments 2 replies
-
A few thoughts:
|
Beta Was this translation helpful? Give feedback.
-
Question about the practical implications ms. boba's suggestion: When using the API in a typescript project, you're forced to check if the work is locked before you can do anything with the work already, would changing this force you to also always check if it's an openDoors project to work with the authors even if you don't care if it is? If so will users find that annoying/cumbersome? |
Beta Was this translation helpful? Give feedback.
-
TypeScript forces you to check before accessing properties only for the properties that aren't common to all the types a variable can have. So for a For export interface Author {
username: string;
pseud: string;
}
export interface OpenDoorsArchivist extends Author {
originalAuthor: string;
}
export interface Ao3WorkSummary {
// omitting irrelevant fields
openDoors: false;
authors: "Anonymous" | Author[];
}
export interface OpenDoorWorkSummary extends Ao3WorkSummary {
openDoors: true;
authors: "Anonymous" | (Author | OpenDoorsArchivist)[];
}
// You can't have this union type with interfaces, so we need to use type here
type WorkSummary = Ao3WorkSummary | OpenDoorWorkSummary; This would make it so that TS would be able to tell that if Practically, I feel like this is pedantic overkill. We could try it though. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Context
On the Archive Of Our Own, a work can be published by one or more users, under a default or non-default pseud, and be included in an anonymous collection or not. If a work is added to an anonymous collection, the work will display its author simply as "Anonymous" regardless of the number of creators.
When a user publishes a work using the default pseud (meaning, the value of the username and the pseud matches) the HTML on the page will be the following:
When the user uses a pseud other than the default:
For multiple creators, the links to the authors are separated by commas:
When a work is part of an anononymous collection:
To account for these different situations, we decided on the following data shape:
where
Author[]
referrs to an array of the following:This works well and (we think) covers the situations mentioned above.
The Issue
However, a new challenger approaches! The Open Doors Project adds an extra quirk. Through OD, when an archive is imported an "archivist" account is created to host works. This account owns any imported works that existing AO3 users don't claim to their own accounts.
What this means in practice is that some works have a different format which looks like the following:
I actually asked around (♥ to volunteers) and apparently a work with two creators would display as:
Author1's Name [archived by x_archivist], Author2's Name [archived by x_archivist]
if neither have claimed the work andAuthor1, Author2's Name [archived by x_archivist]
if one has. And presumably that's the maximum number of imported co-creators that can be added this way.Right now, the function that gets the author of a work looks at links to return the data, so the method is not broken per se, but it does present an issue of not being exactly right (since it sets the value of
author
the same that it would if X_archivist had created the work themselves, which bothers me personally).The road so far..
Here's a summary of what we've discussed so far:
Priorities and considerations:
username
is not null before serving a URL, for example)username
is null or that the work is a OD import (cause they aren't forced to)?Assumptions
Proposals:
create a new property of type boolean for works imported by OD (e.g.
open_doors: true
).author
property corresponds to an archivist account, and not the actual creator of the fanwork?create a new property (e.g.
original_author
) of typeAuthor
to hold the data of the original creator of the work, such that a work will have theauthor
propety set to the archivist account data and theoriginal_author
to one that looks like{ username: null, pseud: "Author's Name" }
string
tostring | null
Add a new type separate from
Author
for the archivist accounts:and then in the
WorkSummary
type:So people can check wether
username
corresponds to the true creator or the archivist account.So yeah! That's the gist of it. Apologies for the length but I wanted everyone to have context so jumping into the discussion is easier, even if it is just to say that this doesn't seem like a huge issue as is works right now :D
Beta Was this translation helpful? Give feedback.
All reactions