Make the author field nullable
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
This commit is contained in:
parent
27eafe4ff4
commit
5227751dca
@ -46,7 +46,7 @@ data class ParecelableItem(
|
|||||||
val link: String,
|
val link: String,
|
||||||
val sourcetitle: String,
|
val sourcetitle: String,
|
||||||
val tags: String,
|
val tags: String,
|
||||||
val author: String
|
val author: String?
|
||||||
) : Parcelable {
|
) : Parcelable {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -73,7 +73,7 @@ class SelfossModel {
|
|||||||
val sourcetitle: String,
|
val sourcetitle: String,
|
||||||
@Serializable(with = TagsListSerializer::class)
|
@Serializable(with = TagsListSerializer::class)
|
||||||
val tags: List<String>,
|
val tags: List<String>,
|
||||||
val author: String
|
val author: String?
|
||||||
) {
|
) {
|
||||||
// TODO: maybe find a better way to handle these kind of urls
|
// TODO: maybe find a better way to handle these kind of urls
|
||||||
fun getLinkDecoded(): String {
|
fun getLinkDecoded(): String {
|
||||||
@ -104,7 +104,7 @@ class SelfossModel {
|
|||||||
|
|
||||||
fun sourceAuthorAndDate(): String {
|
fun sourceAuthorAndDate(): String {
|
||||||
var txt = this.sourcetitle.getHtmlDecoded()
|
var txt = this.sourcetitle.getHtmlDecoded()
|
||||||
if (this.author.isNotEmpty()) {
|
if (!this.author.isNullOrBlank()) {
|
||||||
txt += " (by ${this.author}) "
|
txt += " (by ${this.author}) "
|
||||||
}
|
}
|
||||||
txt += DateUtils.parseRelativeDate(this.datetime)
|
txt += DateUtils.parseRelativeDate(this.datetime)
|
||||||
|
@ -1 +1 @@
|
|||||||
ALTER TABLE ITEM ADD COLUMN `author` TEXT NOT NULL;
|
ALTER TABLE ITEM ADD COLUMN `author` TEXT;
|
@ -10,7 +10,7 @@ CREATE TABLE ITEM (
|
|||||||
`link` TEXT NOT NULL,
|
`link` TEXT NOT NULL,
|
||||||
`sourcetitle` TEXT NOT NULL,
|
`sourcetitle` TEXT NOT NULL,
|
||||||
`tags` TEXT NOT NULL,
|
`tags` TEXT NOT NULL,
|
||||||
`author` TEXT NOT NULL,
|
`author` TEXT,
|
||||||
PRIMARY KEY(`id`)
|
PRIMARY KEY(`id`)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user