mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Continue surgery. Still broken build.
This commit is contained in:
26
Frameworks/Database/Extensions/Article+Database.swift
Normal file
26
Frameworks/Database/Extensions/Article+Database.swift
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Article+Database.swift
|
||||
// Database
|
||||
//
|
||||
// Created by Brent Simmons on 7/3/17.
|
||||
// Copyright © 2017 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import RSDatabase
|
||||
import Data
|
||||
|
||||
extension Article {
|
||||
|
||||
convenience init?(row: FMResultSet) {
|
||||
|
||||
}
|
||||
|
||||
func databaseDictionary() -> NSDictionary {
|
||||
|
||||
var d = NSMutableDictionary()
|
||||
|
||||
|
||||
return d.copy() as! NSDictionary
|
||||
}
|
||||
}
|
||||
52
Frameworks/Database/Extensions/ArticleStatus+Database.swift
Normal file
52
Frameworks/Database/Extensions/ArticleStatus+Database.swift
Normal file
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// ArticleStatus+Database.swift
|
||||
// Database
|
||||
//
|
||||
// Created by Brent Simmons on 7/3/17.
|
||||
// Copyright © 2017 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import RSDatabase
|
||||
import Data
|
||||
|
||||
extension ArticleStatus {
|
||||
|
||||
convenience init?(row: FMResultSet) {
|
||||
|
||||
let articleID = row.string(forColumn: DatabaseKey.articleID)
|
||||
if (articleID == nil) {
|
||||
return nil
|
||||
}
|
||||
let read = row.bool(forColumn: DatabaseKey.read)
|
||||
let starred = row.bool(forColumn: DatabaseKey.starred)
|
||||
let userDeleted = row.bool(forColumn: DatabaseKey.userDeleted)
|
||||
|
||||
var dateArrived = row.date(forColumn: DatabaseKey.dateArrived)
|
||||
if (dateArrived == nil) {
|
||||
dateArrived = NSDate.distantPast
|
||||
}
|
||||
|
||||
let accountInfoPlist = PropertyListTransformer.accountInfoWithRow(row)
|
||||
|
||||
self.init(articleID: articleID!, read: read, starred: starred, userDeleted: userDeleted, dateArrived: dateArrived!, accountInfo: accountInfoPlist)
|
||||
}
|
||||
|
||||
func databaseDictionary() -> NSDictionary {
|
||||
|
||||
let d = NSMutableDictionary()
|
||||
|
||||
d[DatabaseKey.articleID] = articleID
|
||||
d[DatabaseKey.read] = read
|
||||
d[DatabaseKey.starred] = starred
|
||||
d[DatabaseKey.userDeleted] = userDeleted
|
||||
d[DatabaseKey.dateArrived] = dateArrived
|
||||
|
||||
if let accountInfo = accountInfo, let data = PropertyListTransformer.data(withPropertyList: accountInfo) {
|
||||
d[DatabaseKey.accountInfo] = data
|
||||
}
|
||||
|
||||
return d.copy() as! NSDictionary
|
||||
}
|
||||
}
|
||||
|
||||
18
Frameworks/Database/Extensions/Folder+Database.swift
Normal file
18
Frameworks/Database/Extensions/Folder+Database.swift
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// Folder+Database.swift
|
||||
// Database
|
||||
//
|
||||
// Created by Brent Simmons on 7/3/17.
|
||||
// Copyright © 2017 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Data
|
||||
|
||||
extension Folder {
|
||||
|
||||
func flattenedFeedIDs() -> [String] {
|
||||
|
||||
return flattenedFeeds().map { $0.feedID }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user