X-Git-Url: https://git.r.bdr.sh/rbdr/lyricli/blobdiff_plain/b3320a26c57711ae7167f4549338bd0792dbe570..255dbbaee3d3d440da1565b913d982372f72479d:/Sources/source_manager.swift?ds=sidebyside 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) {