Work around Android telling us zero-date when no date is present (#6450)

This commit is contained in:
ByteHamster 2023-05-05 17:19:06 +02:00 committed by GitHub
parent 5a74279ce8
commit e2bbc3ef17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,7 +204,7 @@ public class LocalFeedUpdater {
mediaMetadataRetriever.setDataSource(context, file.getUri());
String dateStr = mediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DATE);
if (!TextUtils.isEmpty(dateStr)) {
if (!TextUtils.isEmpty(dateStr) && !"19040101T000000.000Z".equals(dateStr)) {
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd'T'HHmmss", Locale.getDefault());
item.setPubDate(simpleDateFormat.parse(dateStr));