206
208
for(int i = 0; i < entries.length(); i++) {
207
209
CueEntry entry = entries.at(i);
210
if (!ParseTrackLocation(entry.file, dir, ¤t)) {
211
qWarning() << "failed to parse location in .cue file from " << dir_path;
211
Song song = LoadSong(entry.file, IndexToMarker(entry.index), dir);
213
// cue song has mtime equal to qMax(media_file_mtime, cue_sheet_mtime)
214
if(cue_mtime.isValid()) {
215
song.set_mtime(qMax(cue_mtime.toTime_t(), song.mtime()));
217
song.set_cue_path(playlist_path);
219
// overwrite the stuff, we may have read from the file or library, using
220
// the current .cue metadata
222
// set track number only in single-file mode
224
song.set_track(i + 1);
227
// the last TRACK for every FILE gets it's 'end' marker from the media file's
229
if(i + 1 < entries.size() && entries.at(i).file == entries.at(i + 1).file) {
230
// incorrect indices?
231
if(!UpdateSong(entry, entries.at(i + 1).index, &song)) {
213
// look for the section in library
214
Song song = LoadLibrarySong(current.filename(), IndexToMarker(entry.index));
215
if (!song.is_valid()) {
216
song.InitFromFile(current.filename(), -1);
219
// cue song has mtime equal to qMax(media_file_mtime, cue_sheet_mtime)
220
if(cue_mtime.isValid()) {
221
song.set_mtime(qMax(cue_mtime.toTime_t(), song.mtime()));
223
song.set_cue_path(playlist_path);
225
// overwrite the stuff, we may have read from the file or library, using
226
// the current .cue metadata
228
// set track number only in single-file mode
230
song.set_track(i + 1);
233
// the last TRACK for every FILE gets it's 'end' marker from the media file's
235
if(i + 1 < entries.size() && entries.at(i).file == entries.at(i + 1).file) {
236
// incorrect indices?
237
if(!UpdateSong(entry, entries.at(i + 1).index, &song)) {
242
if(!UpdateLastSong(entry, &song)) {
236
if(!UpdateLastSong(entry, &song)) {