mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-08 21:08:43 +02:00
Return local items on DB lookup
This commit is contained in:
@@ -174,7 +174,7 @@ class Database {
|
||||
public func getLocalLibraryItemByLLId(libraryItem: String) -> LocalLibraryItem? {
|
||||
let items = getLocalLibraryItems()
|
||||
for item in items {
|
||||
if (item.id == libraryItem) {
|
||||
if (item.libraryItemId == libraryItem) {
|
||||
return item
|
||||
}
|
||||
}
|
||||
@@ -182,6 +182,17 @@ class Database {
|
||||
return nil
|
||||
}
|
||||
|
||||
public func getLocalLibraryItem(localLibraryItem: String) -> LocalLibraryItem? {
|
||||
let items = getLocalLibraryItems()
|
||||
for item in items {
|
||||
if (item.id == localLibraryItem) {
|
||||
return item
|
||||
}
|
||||
}
|
||||
NSLog("Local library item with id \(localLibraryItem) not found")
|
||||
return nil
|
||||
}
|
||||
|
||||
public func saveLocalLibraryItem(localLibraryItem: LocalLibraryItem) {
|
||||
Database.realmQueue.sync {
|
||||
do {
|
||||
|
||||
Reference in New Issue
Block a user