-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: import books from Wikisource #9674
Changes from 140 commits
19d9874
f23baad
34667e7
17575bf
dca89fb
147784a
df423ca
604a5d8
34fe390
a307eca
1fe4e84
d7f4065
bcdcdb1
c504f6c
a996e64
a3c299e
0f2b113
e18ba52
4bdf428
57388b4
31b2a7f
9492403
dacef92
1186696
dd82901
47b57c8
3c82121
5e58373
2c268b2
be0d1a8
d52c109
df683a1
8e7cb38
66744ef
5c51bcc
b5e4319
34da18d
76a1724
2ce0e17
3645e9e
0e9650b
9663789
8f0810d
2a3e617
0268018
99f3c93
5390b54
b06b60d
d7561f8
3e10c5d
4bd8e54
e445276
d633c62
4053014
e1bd982
62d1798
25d9243
bbe242f
15aa2b2
cae28f9
cb2a959
5cb9dc9
5370e41
b96a07d
4d4d091
da00d4e
d116d6e
8d83830
f7e61c0
3018a5f
878051c
9135ff5
113e6a7
42c05d0
e9fef40
5193267
2075f4e
dbac756
916c3ae
d1683a5
287bfe0
4ad37de
e8fb019
d8452d8
0d15c54
db5c4a9
3c46c9a
31d84a7
3dbe7b9
d6d303e
aa73b6b
a8fdcfb
916dabc
bb3c30c
e28c8cd
f6f6c99
beaf68c
e6fe169
408da50
e7f714b
8f01b5b
77b23d8
2aca912
7bfc39b
461b02a
147fab3
b73b8d1
92065ed
0750cb2
5842e13
83a00f8
bc31426
2e99560
cb14b14
8d4dac0
7d85a0f
f1b0edd
5b57217
0bd52e8
05f3644
12b96f4
6a8234c
b9c36e4
2fd4569
5a8ea7a
268f055
60e5d00
b6b68f3
e02ae78
d7dd818
ee00b9a
0ecba61
f952c4f
0e2c510
1265681
216cb50
eb8d3d4
d298d39
8c17a14
8917ae8
a174609
ad263aa
ab624f6
320be8b
f07e5fb
3bfe2d9
a0aaf40
d97921d
565853b
d84c5fd
f0a1103
8d3fe1f
eea9276
aca95e0
d3b4767
2545c12
eb3cb40
88648e0
e04b80c
c55261b
abb913c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,12 +29,24 @@ | |
</template> | ||
|
||
<script> | ||
const uuidV4Validator = /^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/ | ||
const genericNumericValidator = /^[0-9]+$/ | ||
pidgezero-one marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const identifierPatterns = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the constant used for autoselection, right? How does this work when some patterns match multiple identifiers? Also, this is maybe scope/feature creep for the PR, since this seems outside the scope of the issues referenced? Might be better to take these bits out to a separate PR. (See also ‘Keep Your Commits “Atomic”’ which can be applied to PRs too.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair point! I included it here because I was using this feature to test the validity of the identifiers being imported. |
||
wikidata: /^Q[1-9]\d*$/i, | ||
isni: /^[0]{4} ?[0-9]{4} ?[0-9]{4} ?[0-9]{3}[0-9X]$/i, | ||
lc_naf: /^n[bors]?[0-9]+$/, | ||
amazon: /^B[0-9A-Za-z]{9}$/, | ||
youtube: /^@[A-Za-z0-9_\-.]{3,30}/, | ||
viaf: genericNumericValidator, | ||
bookbrainz: uuidV4Validator, | ||
musicbrainz: uuidV4Validator, | ||
imdb: /^\w{2}\d+$/, | ||
goodreads: genericNumericValidator, | ||
librarything: /^\S+$/, | ||
librivox: genericNumericValidator, | ||
project_gutenberg: /^[1-9]\d{0,4}$/, | ||
pidgezero-one marked this conversation as resolved.
Show resolved
Hide resolved
|
||
opac_sbn: /^\D{2}[A-Z0-3]V\d{6}$/, | ||
storygraph: uuidV4Validator | ||
pidgezero-one marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
export default { | ||
// Props are for external options; if a subelement of this is modified, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure where it would be best to comment on this, but the Editions import endpoint already has an
identifiers
key for remote identifiers. It probably makes more sense to reuse the name from another import endpoint (so all the import structures are as similar as possible), rather than matching the way the data is loaded on OL Author pages. (Relatedly, a companion PR against https://github.com/internetarchive/openlibrary-client/blob/7e45d512d031970d2bf4f56ca23f6247f205a0a8/olclient/schemata/import.schema.json updating it for the revised schema would be nice. :) )There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me! I suppose I could also support strong book identifiers in the main meat and potatoes of the script.