View Single Post
Old 03-26-2021, 04:08 AM   #10
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
OK, I did some more testing of the code in #7. For some reason it behaves differently for Archive of Our Own and Fanfiction.net.
I am not sure of the transformation rules you want.

Here are transforms implemented by the template in #7
  • Case 1: Book with metadata
    • Publisher: Archive of Our Own
    • Status: In-Progress
    • ids: url:https://archiveofourown/works/12345
    then the template does:
    1. The first 'if' succeeds and
      • adds ao3:12345 to ids
      • removes url:... from ids
      The identifiers are now 'ao3:12345'
    2. The second 'if' condition fails because In-Progress is not in status.
    The result identifiers are 'ao3:12345'. This is wrong? Perhaps the first 'if' is not supposed to remove the url:... identifier?
  • Case 2: If the book has the following metadata:
    • Publisher: FanFiction
    • Status: In-Progress
    • ids: ffnet:abcde, url:https://archiveofourown/works/9876
    then the template does:
    1. The first 'if' condition fails because of wrong publisher, doing nothing
    2. The second 'if' condition fails because status is In-Progress, doing nothing.
    The ids remain 'ffnet:abcde, url:https://archiveofourown/works/9876'. Is this right?
  • Case 3: If the book has the following metadata:
    • Publisher: FanFiction
    • Status: Completed
    • ids: ffnet:abcde, url:https://archiveofourown/works/9876
    then the template does:
    1. The first 'if' condition fails because of wrong publisher, doing nothing
    2. The second 'if' condition succeeds because status is Completed. The url:... id is removed.
    The ids become 'ffnet:abcde'. Is this right?
You also must be careful about the order of evaluation. The second 'if' condition might succeed because the first 'if' adds the identifier 'ao3'. You may or may not always want that.
chaley is offline   Reply With Quote