Add and use new HTMLMetadataDownloader. Fix #4414.

This commit is contained in:
Brent Simmons
2024-12-14 10:15:51 -08:00
parent c38e5d6abe
commit b651131fbd
8 changed files with 221 additions and 200 deletions

View File

@@ -0,0 +1,37 @@
//
// Date+Extensions.swift
// RSCore
//
// Created by Brent Simmons on 6/21/16.
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
//
import Foundation
public extension Date {
// Below are for rough use only they don't use the calendar.
func bySubtracting(days: Int) -> Date {
return addingTimeInterval(0.0 - TimeInterval(days: days))
}
func bySubtracting(hours: Int) -> Date {
return addingTimeInterval(0.0 - TimeInterval(hours: hours))
}
func byAdding(days: Int) -> Date {
return addingTimeInterval(TimeInterval(days: days))
}
}
public extension TimeInterval {
init(days: Int) {
self.init(days * 24 * 60 * 60)
}
init(hours: Int) {
self.init(hours * 60 * 60)
}
}