Ignore:
Timestamp:
2021-09-20T16:50:02+12:00 (3 years ago)
Author:
cstephen
Message:

Check for duplicates before transcribing them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/main.js

    r35432 r35433  
    1313    constructor(transcription, file) {
    1414        /** @type {String} The UUID of this transcription. */
    15         this.id = file.name + file.size + file.type; // Should be a fairly reliable indicator of uniqueness.
     15        this.id = TranscriptionViewModel.getId(file); // Should be a fairly reliable indicator of uniqueness.
    1616
    1717        /** @type {String} The transcription. */
     
    2626        /** @type {File} The file from which the transcription was generated. */
    2727        this.file = file;
     28    }
     29
     30    static getId(file) {
     31        return file.name + file.size + file.type;
    2832    }
    2933}
     
    110114            state.translations = translations;
    111115        }
     116    },
     117    getters: {
     118        hasTranscriptionOfFile: (state) => (file) => {
     119            const id = TranscriptionViewModel.getId(file);
     120            return state.rawTranscriptions.has(id);
     121        }
    112122    }
    113123});
Note: See TracChangeset for help on using the changeset viewer.