X-Git-Url: https://git.r.bdr.sh/rbdr/lyricli/blobdiff_plain/b3320a26c57711ae7167f4549338bd0792dbe570..74b4bbe9f35e7d29e0822a892b8498cab9b1801c:/Sources/source_manager.swift diff --git a/Sources/source_manager.swift b/Sources/source_manager.swift index dd956ad..e55cc8b 100644 --- a/Sources/source_manager.swift +++ b/Sources/source_manager.swift @@ -6,16 +6,13 @@ class SourceManager { ] var currentTrack: Track? { - get { - - for source in enabledSources { - if let currentTrack = source.currentTrack { - return currentTrack - } + for source in enabledSources { + if let currentTrack = source.currentTrack { + return currentTrack } - - return nil } + + return nil } var enabledSources: [Source] { @@ -23,19 +20,17 @@ class SourceManager { // Checks the config and returns an array of sources based on the // enabled and available ones - get { - var sources = [Source]() + var sources = [Source]() - if let sourceNames = Configuration.sharedInstance["enabled_sources"] as? [String]{ - for sourceName in sourceNames { - if let source = availableSources[sourceName] { - sources.append(source) - } + if let sourceNames = Configuration.sharedInstance["enabled_sources"] as? [String] { + for sourceName in sourceNames { + if let source = availableSources[sourceName] { + sources.append(source) } } - - return sources } + + return sources } func enable(sourceName: String) {