Fix order of voice categories in local indexes
This commit is contained in:
parent
9d7aba4651
commit
ebcd44c2e6
1 changed files with 18 additions and 8 deletions
|
@ -109,23 +109,33 @@ public class LocalIndexHelper {
|
|||
|
||||
private void loadVoiceData(File voiceDir, List<LocalIndexInfo> result, boolean backup, LoadLocalIndexTask loadTask) {
|
||||
if (voiceDir.canRead()) {
|
||||
//First list TTS files, they are preferred
|
||||
for (File voiceF : listFilesSorted(voiceDir)) {
|
||||
if (voiceF.isDirectory()) {
|
||||
if (voiceF.isDirectory() && !MediaCommandPlayerImpl.isMyData(voiceF) && (Build.VERSION.SDK_INT >= 4)) {
|
||||
LocalIndexInfo info = null;
|
||||
if (MediaCommandPlayerImpl.isMyData(voiceF)) {
|
||||
info = new LocalIndexInfo(LocalIndexType.VOICE_DATA, voiceF, backup);
|
||||
} else if (Build.VERSION.SDK_INT >= 4) {
|
||||
if (TTSCommandPlayerImpl.isMyData(voiceF)) {
|
||||
info = new LocalIndexInfo(LocalIndexType.TTS_VOICE_DATA, voiceF, backup);
|
||||
}
|
||||
if (TTSCommandPlayerImpl.isMyData(voiceF)) {
|
||||
info = new LocalIndexInfo(LocalIndexType.TTS_VOICE_DATA, voiceF, backup);
|
||||
}
|
||||
if(info != null){
|
||||
if(info != null) {
|
||||
updateDescription(info);
|
||||
result.add(info);
|
||||
loadTask.loadFile(info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Now list recorded voices
|
||||
for (File voiceF : listFilesSorted(voiceDir)) {
|
||||
if (voiceF.isDirectory() && MediaCommandPlayerImpl.isMyData(voiceF)) {
|
||||
LocalIndexInfo info = null;
|
||||
info = new LocalIndexInfo(LocalIndexType.VOICE_DATA, voiceF, backup);
|
||||
}
|
||||
if(info != null){
|
||||
updateDescription(info);
|
||||
result.add(info);
|
||||
loadTask.loadFile(info);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue