(back) Add location for albums
This commit is contained in:
@@ -192,7 +192,8 @@ class ITunesParser:
|
||||
'Avg Bit Rate': track['Bit Rate'],
|
||||
'Min Bit Rate': track['Bit Rate'],
|
||||
# 'Album Artist': '',
|
||||
'Total Time': 0
|
||||
'Total Time': 0,
|
||||
'Location': ''
|
||||
}
|
||||
|
||||
# Compute information
|
||||
@@ -207,6 +208,8 @@ class ITunesParser:
|
||||
self._albums[akey]['Play Count'] += play_count
|
||||
self._albums[akey]['Total Time'] += total_time
|
||||
|
||||
self._albums[akey]['Location'] = os.path.dirname(track['Location'])
|
||||
|
||||
if self._albums[akey]['Min Bit Rate'] > track['Bit Rate']:
|
||||
self._albums[akey]['Min Bit Rate'] = track['Bit Rate']
|
||||
|
||||
|
||||
@@ -1,4 +1,28 @@
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
"analyzer": {
|
||||
"custom_path_tree": {
|
||||
"tokenizer": "custom_hierarchy"
|
||||
},
|
||||
"custom_path_tree_reversed": {
|
||||
"tokenizer": "custom_hierarchy_reversed"
|
||||
}
|
||||
},
|
||||
"tokenizer": {
|
||||
"custom_hierarchy": {
|
||||
"type": "path_hierarchy",
|
||||
"delimiter": "/",
|
||||
"skip": 3
|
||||
},
|
||||
"custom_hierarchy_reversed": {
|
||||
"type": "path_hierarchy",
|
||||
"delimiter": "/",
|
||||
"reverse": "true"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"mappings" : {
|
||||
"properties": {
|
||||
"Artist": {
|
||||
@@ -21,6 +45,19 @@
|
||||
},
|
||||
"Genre": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"Location": {
|
||||
"type": "text",
|
||||
"fields": {
|
||||
"tree": {
|
||||
"type": "text",
|
||||
"analyzer": "custom_path_tree"
|
||||
},
|
||||
"tree_reversed": {
|
||||
"type": "text",
|
||||
"analyzer": "custom_path_tree_reversed"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +1,24 @@
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
"analyzer": {
|
||||
"custom_path_tree": {
|
||||
"tokenizer": "custom_hierarchy"
|
||||
"analyzer": {
|
||||
"custom_path_tree": { "tokenizer": "custom_hierarchy" },
|
||||
"custom_path_tree_reversed": { "tokenizer": "custom_hierarchy_reversed" }
|
||||
},
|
||||
"custom_path_tree_reversed": {
|
||||
"tokenizer": "custom_hierarchy_reversed"
|
||||
"tokenizer": {
|
||||
"custom_hierarchy": {
|
||||
"type": "path_hierarchy",
|
||||
"delimiter": "/",
|
||||
"skip": 3
|
||||
},
|
||||
"custom_hierarchy_reversed": {
|
||||
"type": "path_hierarchy",
|
||||
"delimiter": "/",
|
||||
"reverse": "true"
|
||||
}
|
||||
}
|
||||
},
|
||||
"tokenizer": {
|
||||
"custom_hierarchy": {
|
||||
"type": "path_hierarchy",
|
||||
"delimiter": "/",
|
||||
"skip": 3
|
||||
},
|
||||
"custom_hierarchy_reversed": {
|
||||
"type": "path_hierarchy",
|
||||
"delimiter": "/",
|
||||
"reverse": "true"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
"mappings" : {
|
||||
"properties": {
|
||||
"Artist": {
|
||||
|
||||
Reference in New Issue
Block a user