Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ ALL_AUTHORS - All authors in the list of authors separated by ','
SERIES_NAME - The series name, if it exists
SERIES_NUM - The books respective series number, if it exists
BOOK_TITLE - The book title
BOOK_SIBTITLE - The book subtitle, if it exists
ISBN - The ISBN of the book
FIRST_NARRATOR - The first narrator in the list of narrators
ALL_NARRATORS - All narrators in the list of narrators separated by ','
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ abstract class AppComponent(
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ data class Book(
val publication_date: Instant,
val description: String,
val genres: List<Genre>,
val subtitle: String? = null,
val series: String? = null,
val series_num: Int? = null
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ enum class PathTokens {
PUBLICATION_MONTH,
PUBLICATION_DAY,
SERIES_NUM,
BOOK_SUBTITLE,
}

fun PathTokens.convert(book: Book): String {
Expand All @@ -32,6 +33,7 @@ fun PathTokens.convert(book: Book): String {
PathTokens.PUBLICATION_MONTH -> book.publication_date.toLocalDateTime(TimeZone.UTC).month.number.toString()
PathTokens.PUBLICATION_DAY -> book.publication_date.toLocalDateTime(TimeZone.UTC).dayOfMonth.toString()
PathTokens.SERIES_NUM -> book.series_num?.toString() ?: ""
PathTokens.BOOK_SUBTITLE -> book.subtitle ?: ""
}
}

Expand Down