mirror of
https://github.com/stonega/tsacdop
synced 2025-02-27 00:37:42 +01:00
Bug fixed, date parse error, change ignore to replace when subscribe podcast.
This commit is contained in:
parent
d5be6c13de
commit
a40c94e811
@ -391,17 +391,15 @@ class DBHelper {
|
|||||||
var month = mmDd.stringMatch(pubDate);
|
var month = mmDd.stringMatch(pubDate);
|
||||||
date =
|
date =
|
||||||
DateFormat('yyyy-MM-dd HH:mm', 'en_US').parse('$month $time');
|
DateFormat('yyyy-MM-dd HH:mm', 'en_US').parse('$month $time');
|
||||||
print(date.toString());
|
|
||||||
} else {
|
} else {
|
||||||
date = DateTime.now();
|
date = DateTime.now();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var result = date
|
date.add(Duration(hours: timezoneInt)).add(DateTime.now().timeZoneOffset);
|
||||||
.add(Duration(hours: timezoneInt))
|
print(date.toString());
|
||||||
.add(DateTime.now().timeZoneOffset);
|
return date;
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int _getExplicit(bool b) {
|
int _getExplicit(bool b) {
|
||||||
@ -461,7 +459,7 @@ class DBHelper {
|
|||||||
if (url != null) {
|
if (url != null) {
|
||||||
await dbClient.transaction((txn) {
|
await dbClient.transaction((txn) {
|
||||||
return txn.rawInsert(
|
return txn.rawInsert(
|
||||||
"""INSERT OR IGNORE INTO Episodes(title, enclosure_url, enclosure_length, pubDate,
|
"""INSERT OR REPLACE INTO Episodes(title, enclosure_url, enclosure_length, pubDate,
|
||||||
description, feed_id, milliseconds, duration, explicit, media_id) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""",
|
description, feed_id, milliseconds, duration, explicit, media_id) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""",
|
||||||
[
|
[
|
||||||
title,
|
title,
|
||||||
@ -524,6 +522,7 @@ class DBHelper {
|
|||||||
final length = item?.enclosure?.length ?? 0;
|
final length = item?.enclosure?.length ?? 0;
|
||||||
final pubDate = item.pubDate;
|
final pubDate = item.pubDate;
|
||||||
final date = _parsePubDate(pubDate);
|
final date = _parsePubDate(pubDate);
|
||||||
|
print(date.toString());
|
||||||
final milliseconds = date.millisecondsSinceEpoch;
|
final milliseconds = date.millisecondsSinceEpoch;
|
||||||
final duration = item.itunes.duration?.inSeconds ?? 0;
|
final duration = item.itunes.duration?.inSeconds ?? 0;
|
||||||
final explicit = _getExplicit(item.itunes.explicit);
|
final explicit = _getExplicit(item.itunes.explicit);
|
||||||
@ -1050,9 +1049,13 @@ class DBHelper {
|
|||||||
|
|
||||||
Future<bool> isLiked(String url) async {
|
Future<bool> isLiked(String url) async {
|
||||||
var dbClient = await database;
|
var dbClient = await database;
|
||||||
List<Map> list = await dbClient
|
var list = <Map>[];
|
||||||
|
list = await dbClient
|
||||||
.rawQuery("SELECT liked FROM Episodes WHERE enclosure_url = ?", [url]);
|
.rawQuery("SELECT liked FROM Episodes WHERE enclosure_url = ?", [url]);
|
||||||
return list.first['liked'] == 0 ? false : true;
|
if (list.isNotEmpty) {
|
||||||
|
return list.first['liked'] == 0 ? false : true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> isDownloaded(String url) async {
|
Future<bool> isDownloaded(String url) async {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user