forked from rc/aircox
		
	make Vue track Track change
This commit is contained in:
		@ -89,9 +89,12 @@ class Importer:
 | 
				
			|||||||
                tags = line.get('tags')
 | 
					                tags = line.get('tags')
 | 
				
			||||||
                if tags:
 | 
					                if tags:
 | 
				
			||||||
                    track.tags.add(*tags.split(','))
 | 
					                    track.tags.add(*tags.split(','))
 | 
				
			||||||
            except:
 | 
					            except Exception as err:
 | 
				
			||||||
                logger.warning('an error occured for track {index}, it may not '
 | 
					                logger.warning(
 | 
				
			||||||
                               'have been saved'.format(index = index))
 | 
					                    'an error occured for track {index}, it may not '
 | 
				
			||||||
 | 
					                    'have been saved: {err}'
 | 
				
			||||||
 | 
					                    .format(index = index, err=err)
 | 
				
			||||||
 | 
					                )
 | 
				
			||||||
                continue
 | 
					                continue
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if save:
 | 
					            if save:
 | 
				
			||||||
 | 
				
			|||||||
@ -16,6 +16,11 @@ class Track {
 | 
				
			|||||||
    // If url and interval are given, use them to retrieve regularely
 | 
					    // If url and interval are given, use them to retrieve regularely
 | 
				
			||||||
    // the track informations
 | 
					    // the track informations
 | 
				
			||||||
    constructor(data) {
 | 
					    constructor(data) {
 | 
				
			||||||
 | 
					        Object.assign(this, {
 | 
				
			||||||
 | 
					            'name': '',
 | 
				
			||||||
 | 
					            'detail_url': '',
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Object.assign(this, data);
 | 
					        Object.assign(this, data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if(this.data_url) {
 | 
					        if(this.data_url) {
 | 
				
			||||||
@ -62,7 +67,7 @@ class Track {
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
                data = {
 | 
					                data = {
 | 
				
			||||||
                    title: data.title,
 | 
					                    name: data.title,
 | 
				
			||||||
                    detail_url: data.url
 | 
					                    detail_url: data.url
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            Object.assign(self, data);
 | 
					            Object.assign(self, data);
 | 
				
			||||||
@ -102,8 +107,6 @@ var Sound = Vue.extend({
 | 
				
			|||||||
            state: State.Stop,
 | 
					            state: State.Stop,
 | 
				
			||||||
            // current position in playing sound
 | 
					            // current position in playing sound
 | 
				
			||||||
            position: 0,
 | 
					            position: 0,
 | 
				
			||||||
            // url to the page related to the sound
 | 
					 | 
				
			||||||
            detail_url: '',
 | 
					 | 
				
			||||||
            // estimated position when user mouse over progress bar
 | 
					            // estimated position when user mouse over progress bar
 | 
				
			||||||
            user_seek: null,
 | 
					            user_seek: null,
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
 | 
				
			|||||||
@ -32,7 +32,7 @@
 | 
				
			|||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <div class="content flex_item">
 | 
					        <div class="content flex_item">
 | 
				
			||||||
            <h3 class="flex_item">
 | 
					            <h3 class="flex_item">
 | 
				
			||||||
                <a :href="detail_url">[[ track.name ]]</a>
 | 
					                <a :href="track.detail_url">[[ track.name ]]</a>
 | 
				
			||||||
            </h3>
 | 
					            </h3>
 | 
				
			||||||
            <div v-if="track.duration" class="info">
 | 
					            <div v-if="track.duration" class="info">
 | 
				
			||||||
                <span v-if="seek_position !== null">
 | 
					                <span v-if="seek_position !== null">
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user