mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-04 10:04:39 +02:00
Return local items on DB lookup
This commit is contained in:
parent
9eca03cfd7
commit
32550a75ec
3 changed files with 47 additions and 8 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue