@@ -198,7 +198,7 @@ void TagReader::ReadFile(const QString& filename,
198
198
// Find album artists
199
199
TagLib::APE::ItemListMap::ConstIterator it = items.find (" ALBUM ARTIST" );
200
200
if (it != items.end ()) {
201
- TagLib::StringList album_artists = it->second .toStringList ();
201
+ TagLib::StringList album_artists = it->second .values ();
202
202
if (!album_artists.isEmpty ()) {
203
203
Decode (album_artists.front (), nullptr , song->mutable_albumartist ());
204
204
}
@@ -243,22 +243,22 @@ void TagReader::ReadFile(const QString& filename,
243
243
}
244
244
245
245
if (items.contains (" BPM" )) {
246
- Decode (items[" BPM" ].toStringList ().toString (" , " ), nullptr ,
246
+ Decode (items[" BPM" ].values ().toString (" , " ), nullptr ,
247
247
song->mutable_performer ());
248
248
}
249
249
250
250
if (items.contains (" PERFORMER" )) {
251
- Decode (items[" PERFORMER" ].toStringList ().toString (" , " ), nullptr ,
251
+ Decode (items[" PERFORMER" ].values ().toString (" , " ), nullptr ,
252
252
song->mutable_performer ());
253
253
}
254
254
255
255
if (items.contains (" COMPOSER" )) {
256
- Decode (items[" COMPOSER" ].toStringList ().toString (" , " ), nullptr ,
256
+ Decode (items[" COMPOSER" ].values ().toString (" , " ), nullptr ,
257
257
song->mutable_composer ());
258
258
}
259
259
260
260
if (items.contains (" GROUPING" )) {
261
- Decode (items[" GROUPING" ].toStringList ().toString (" " ), nullptr ,
261
+ Decode (items[" GROUPING" ].values ().toString (" " ), nullptr ,
262
262
song->mutable_grouping ());
263
263
}
264
264
@@ -565,8 +565,8 @@ void TagReader::ReadFile(const QString& filename,
565
565
if (fileref->audioProperties ()) {
566
566
song->set_bitrate (fileref->audioProperties ()->bitrate ());
567
567
song->set_samplerate (fileref->audioProperties ()->sampleRate ());
568
- song->set_length_nanosec (fileref->audioProperties ()->length () *
569
- kNsecPerSec );
568
+ song->set_length_nanosec (fileref->audioProperties ()->lengthInMilliseconds () *
569
+ kNsecPerMsec );
570
570
}
571
571
572
572
// Get the filetype if we can
@@ -1376,9 +1376,9 @@ bool TagReader::ReadCloudFile(const QUrl& download_url, const QString& title,
1376
1376
std::unique_ptr<TagLib::File> tag;
1377
1377
if (mime_type == " audio/mpeg" &&
1378
1378
title.endsWith (" .mp3" , Qt::CaseInsensitive)) {
1379
- tag.reset (new TagLib::MPEG::File (stream.get (),
1380
- TagLib::ID3v2::FrameFactory::instance () ,
1381
- TagLib::AudioProperties::Accurate ));
1379
+ tag.reset (new TagLib::MPEG::File (stream.get (), true ,
1380
+ TagLib::AudioProperties::Accurate ,
1381
+ TagLib::ID3v2::FrameFactory::instance () ));
1382
1382
} else if (mime_type == " audio/mp4" ||
1383
1383
(mime_type == " audio/mpeg" &&
1384
1384
title.endsWith (" .m4a" , Qt::CaseInsensitive))) {
@@ -1398,9 +1398,9 @@ bool TagReader::ReadCloudFile(const QUrl& download_url, const QString& title,
1398
1398
TagLib::AudioProperties::Accurate));
1399
1399
} else if (mime_type == " application/x-flac" || mime_type == " audio/flac" ||
1400
1400
mime_type == " audio/x-flac" ) {
1401
- tag.reset (new TagLib::FLAC::File (stream.get (),
1402
- TagLib::ID3v2::FrameFactory::instance () ,
1403
- true , TagLib::AudioProperties::Accurate ));
1401
+ tag.reset (new TagLib::FLAC::File (stream.get (), true ,
1402
+ TagLib::AudioProperties::Accurate ,
1403
+ TagLib::ID3v2::FrameFactory::instance () ));
1404
1404
} else if (mime_type == " audio/x-ms-wma" ) {
1405
1405
tag.reset (new TagLib::ASF::File (stream.get (), true ,
1406
1406
TagLib::AudioProperties::Accurate));
@@ -1431,7 +1431,7 @@ bool TagReader::ReadCloudFile(const QUrl& download_url, const QString& title,
1431
1431
song->set_type (cpb::tagreader::SongMetadata_Type_STREAM);
1432
1432
1433
1433
if (tag->audioProperties ()) {
1434
- song->set_length_nanosec (tag->audioProperties ()->length () * kNsecPerSec );
1434
+ song->set_length_nanosec (tag->audioProperties ()->lengthInMilliseconds () * kNsecPerMsec );
1435
1435
}
1436
1436
return true ;
1437
1437
}
0 commit comments