fix dockerfile
authormarcelveldt <marcelvanderveldt@MacBook-Silvia.local>
Tue, 15 Oct 2019 22:34:03 +0000 (00:34 +0200)
committermarcelveldt <marcelvanderveldt@MacBook-Silvia.local>
Tue, 15 Oct 2019 22:34:03 +0000 (00:34 +0200)
Dockerfile
music_assistant/config.py
music_assistant/web/pages/config.vue.js

index d0b9aea1e92d871da0a6142b68e5a22f5c924648..b042502b92b0ad58ddf6131f0f7de21b60374867 100755 (executable)
@@ -12,7 +12,7 @@ RUN pip install -r requirements.txt
 RUN mkdir -p /usr/src/app
 WORKDIR /usr/src/app
 COPY music_assistant /usr/src/app/music_assistant
-COPY mass.py /usr/src/app/main.py
+COPY mass.py /usr/src/app/mass.py
 RUN chmod a+x /usr/src/app/mass.py
 
 VOLUME ["/data"]
index 8de4febd7ff1dcb182b1cb75d1f691e3151f257b..ed49bac3fe09504c4811f190ef9541a25b8c7211 100755 (executable)
@@ -57,11 +57,14 @@ class MassConfig(dict):
 
     def __setitem__(self, key, new_value):
         # optional processing here
-        if self[key] != new_value:
+        if key not in self:
+            super().__setitem__(key, new_value)
+        elif self[key] != new_value:
             # value changed
+            super().__setitem__(key, new_value)
             self[key] = new_value
             self.mass.event_loop.create_task(
-                    self.mass.signal_event(EVENT_CONFIG_CHANGED, self.__dict__))
+                    self.mass.signal_event(EVENT_CONFIG_CHANGED, self))
             self.__save()
 
     def __save(self):
index c4164db2dae1d9e99fc503e1520ae5a60cee3499..0bc9ff1d6c3a4c9832ea69084f70d3b7587c9b8d 100755 (executable)
@@ -21,10 +21,10 @@ var Config = Vue.component('Config', {
                               </template>
                               <div v-for="conf_item_key in conf[conf_key][conf_subkey].__desc__">
                                     <v-list-tile>
-                                          <v-switch v-if="typeof(conf_item_key[1]) == 'boolean'" v-model="conf[conf_key][conf_subkey][conf_item_key[0]]" :label="$t('conf.'+conf_item_key[2])"></v-switch>
-                                          <v-text-field v-else-if="conf_item_key[1] == '<password>'" v-model="conf[conf_key][conf_subkey][conf_item_key[0]]" :label="$t('conf.'+conf_item_key[2])" box type="password"></v-text-field>
-                                          <v-select v-else-if="conf_item_key[1] == '<player>'" v-model="conf[conf_key][conf_subkey][conf_item_key[0]]" :label="$t('conf.'+conf_item_key[2])" box type="password"></v-select>
-                                          <v-text-field v-else v-model="conf[conf_key][conf_subkey][conf_item_key[0]]" :label="$t('conf.'+conf_item_key[2])" box></v-text-field>
+                                          <v-switch v-if="typeof(conf_item_key[1]) == 'boolean'" v-model="conf[conf_key][conf_subkey][conf_item_key[0]]" :label="$t('conf.'+conf_item_key[2])" @change="confChanged(conf_key, conf_subkey, conf[conf_key][conf_subkey])"></v-switch>
+                                          <v-text-field v-else-if="conf_item_key[1] == '<password>'" v-model="conf[conf_key][conf_subkey][conf_item_key[0]]" :label="$t('conf.'+conf_item_key[2])" box type="password" @change="confChanged(conf_key, conf_subkey, conf[conf_key][conf_subkey])"></v-text-field>
+                                          <v-select v-else-if="conf_item_key[1] == '<player>'" v-model="conf[conf_key][conf_subkey][conf_item_key[0]]" :label="$t('conf.'+conf_item_key[2])" box type="password" @change="confChanged(conf_key, conf_subkey, conf[conf_key][conf_subkey])"></v-select>
+                                          <v-text-field v-else v-model="conf[conf_key][conf_subkey][conf_item_key[0]]" :label="$t('conf.'+conf_item_key[2])" @change="confChanged(conf_key, conf_subkey, conf[conf_key][conf_subkey])" box></v-text-field>
                                     </v-list-tile>
                                 </div>
                                 <v-divider></v-divider>
@@ -97,16 +97,16 @@ var Config = Vue.component('Config', {
     }
   },
   watch: {
-    'conf': {
-        handler: _.debounce(function (val, oldVal) {
-          if (oldVal.base) {
-            console.log("save config needed!");
-            this.saveConfig();
-            this.$toasted.show(this.$t('conf.conf_saved'))
-          }
-        }, 5000),
-        deep: true
-    }
+    // 'conf': {
+    //     handler: _.debounce(function (val, oldVal) {
+    //       if (oldVal.base) {
+    //         console.log("save config needed!");
+    //         this.saveConfig();
+    //         this.$toasted.show(this.$t('conf.conf_saved'))
+    //       }
+    //     }, 5000),
+    //     deep: true
+    // }
   },
   created() {
     this.$globals.windowtitle = this.$t('settings');
@@ -135,6 +135,11 @@ var Config = Vue.component('Config', {
           console.log("error", error);
         });
     },
+    confChanged(key, subkey, newvalue) {
+      console.log(key + "/" + subkey + " changed!");
+      console.log(newvalue);
+
+    },
     getPlayers () {
       const api_url = '/api/players';
       axios