]> git.r.bdr.sh - rbdr/lyricli/blobdiff - Sources/source_manager.swift
Add linting to travis
[rbdr/lyricli] / Sources / source_manager.swift
index d0af81720325aef3684ef06034ad3caa0bfffbc8..e55cc8b18ae19e1acc222b442c6be788b21ea09c 100644 (file)
@@ -1,21 +1,18 @@
 /// Manages the different sources. Keeps track of them, lists and toggles
-public class SourceManager {
+class SourceManager {
 
     private var availableSources: [String: Source] = [
         "arguments": ArgumentsSource()
     ]
 
     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 @@ public 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) {