mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-16 19:31:02 +01:00
Slightly hacky support for AAC on Google Drive.
This commit is contained in:
parent
fc61f0627f
commit
94878b4bd2
@ -623,11 +623,16 @@ bool TagReaderWorker::ReadGoogleDrive(const QUrl& download_url,
|
|||||||
download_url, title, size, access_token, network_);
|
download_url, title, size, access_token, network_);
|
||||||
stream->Precache();
|
stream->Precache();
|
||||||
scoped_ptr<TagLib::File> tag;
|
scoped_ptr<TagLib::File> tag;
|
||||||
if (mime_type == "audio/mpeg") {
|
if (mime_type == "audio/mpeg" && title.endsWith(".mp3")) {
|
||||||
tag.reset(new TagLib::MPEG::File(
|
tag.reset(new TagLib::MPEG::File(
|
||||||
stream, // Takes ownership.
|
stream, // Takes ownership.
|
||||||
TagLib::ID3v2::FrameFactory::instance(),
|
TagLib::ID3v2::FrameFactory::instance(),
|
||||||
TagLib::AudioProperties::Accurate));
|
TagLib::AudioProperties::Accurate));
|
||||||
|
} else if (mime_type == "audio/mpeg" && title.endsWith(".m4a")) {
|
||||||
|
tag.reset(new TagLib::MP4::File(
|
||||||
|
stream,
|
||||||
|
true,
|
||||||
|
TagLib::AudioProperties::Accurate));
|
||||||
} else if (mime_type == "application/ogg") {
|
} else if (mime_type == "application/ogg") {
|
||||||
tag.reset(new TagLib::Ogg::Vorbis::File(
|
tag.reset(new TagLib::Ogg::Vorbis::File(
|
||||||
stream,
|
stream,
|
||||||
@ -657,6 +662,13 @@ bool TagReaderWorker::ReadGoogleDrive(const QUrl& download_url,
|
|||||||
song->set_album(tag->tag()->album().toCString(true));
|
song->set_album(tag->tag()->album().toCString(true));
|
||||||
song->set_filesize(size);
|
song->set_filesize(size);
|
||||||
|
|
||||||
|
if (tag->tag()->track() != 0) {
|
||||||
|
song->set_track(tag->tag()->track());
|
||||||
|
}
|
||||||
|
if (tag->tag()->year() != 0) {
|
||||||
|
song->set_year(tag->tag()->year());
|
||||||
|
}
|
||||||
|
|
||||||
song->set_type(pb::tagreader::SongMetadata_Type_STREAM);
|
song->set_type(pb::tagreader::SongMetadata_Type_STREAM);
|
||||||
|
|
||||||
if (tag->audioProperties()) {
|
if (tag->audioProperties()) {
|
||||||
|
@ -103,7 +103,7 @@ void GoogleDriveService::ConnectFinished(google_drive::ConnectResponse* response
|
|||||||
s.setValue("refresh_token", response->refresh_token());
|
s.setValue("refresh_token", response->refresh_token());
|
||||||
|
|
||||||
// Find any music files
|
// Find any music files
|
||||||
ListFilesForMimeType("audio/mpeg"); // MP3
|
ListFilesForMimeType("audio/mpeg"); // MP3/AAC
|
||||||
ListFilesForMimeType("application/ogg"); // OGG
|
ListFilesForMimeType("application/ogg"); // OGG
|
||||||
ListFilesForMimeType("application/x-flac"); // FLAC
|
ListFilesForMimeType("application/x-flac"); // FLAC
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user