Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cover Art Fetcher #4851

Merged
merged 24 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
40e21b0
coverartfetcher: update the latest status.
fatihemreyildiz Jul 11, 2022
200f37e
dlgtagfetcher.ui: fix wrong display.
fatihemreyildiz Oct 16, 2022
bb7ec6d
dlgtagfetcher: comment add to fetching user choice
fatihemreyildiz Oct 16, 2022
6885b35
imagefiledata: improve format not matching warning
fatihemreyildiz Oct 16, 2022
50318f1
dlgtagfetcher: polished & deleted redundants.
fatihemreyildiz Oct 16, 2022
8a0dc28
dlgtagfetcher: CA constants added for progressbar
fatihemreyildiz Oct 16, 2022
b1379db
cacworker: worker refactored for cover art fetcher
fatihemreyildiz Oct 16, 2022
b4bb70e
dlgtagfetcher: cacopyworker implemented.
fatihemreyildiz Oct 16, 2022
69ac2d6
dlgcoverartfullsize: special init renamed & tr add
fatihemreyildiz Nov 13, 2022
ceb3978
dlgtagfetcher: polishing & check add for urls
fatihemreyildiz Nov 13, 2022
850db44
dlgtagfetcher: ui methods move to related .ui file
fatihemreyildiz Nov 13, 2022
01d0400
tagfetcher: updated to latest musicbrainz fixes.
fatihemreyildiz Nov 13, 2022
4e53b07
DlgCoverArtFullSize: adjust for population via CoverArtFetcher
ronso0 Nov 20, 2022
cf54d53
DlgPrefLibrary::slotResetToDefaults: remove obsolete actions
ronso0 Nov 20, 2022
a79b1bb
dlgpreflibrary: Preference changed with pixels
fatihemreyildiz Nov 21, 2022
4c1cc06
coverartfetcher: fix pre-commit.
fatihemreyildiz Nov 21, 2022
c3cd368
covarartarchiveitasks: p prefix added for pointers
fatihemreyildiz Nov 22, 2022
d59da65
coverartarchiveimagetask: missing emit methods add
fatihemreyildiz Nov 22, 2022
b5a5e72
dlgtagfetcher: fixed 500px cover art not fetching.
fatihemreyildiz Nov 24, 2022
7455068
dlgtagfetcher: compose fetched CA path improved
fatihemreyildiz Nov 24, 2022
32e95f9
coverartarchivelinkstask: example JSON schema add
fatihemreyildiz Nov 24, 2022
6bb4db1
dlgtagfetcher: redundant disconnect deleted
fatihemreyildiz Dec 1, 2022
5e48d83
dlgtagfetcher: add fetched coverart always deleted
fatihemreyildiz Dec 1, 2022
697f41a
dlgtagfetcher: p prefix added for pointers
fatihemreyildiz Dec 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,8 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/musicbrainz/musicbrainzxml.cpp
src/musicbrainz/tagfetcher.cpp
src/musicbrainz/web/acoustidlookuptask.cpp
src/musicbrainz/web/coverartarchiveimagetask.cpp
src/musicbrainz/web/coverartarchivelinkstask.cpp
src/musicbrainz/web/musicbrainzrecordingstask.cpp
src/network/jsonwebtask.cpp
src/network/networktask.cpp
Expand Down
20 changes: 19 additions & 1 deletion src/library/dlgcoverartfullsize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ DlgCoverArtFullSize::DlgCoverArtFullSize(
WCoverArtMenu* pCoverMenu)
: QDialog(parent),
m_pPlayer(pPlayer),
m_pCoverMenu(pCoverMenu) {
m_pCoverMenu(pCoverMenu),
m_coverPressed(false) {
CoverArtCache* pCache = CoverArtCache::instance();
if (pCache) {
connect(pCache,
Expand Down Expand Up @@ -82,6 +83,19 @@ void DlgCoverArtFullSize::init(TrackPointer pTrack) {
slotLoadTrack(pTrack);
}

void DlgCoverArtFullSize::initFetchedCoverArt(const QByteArray& fetchedCoverArtBytes) {
m_pixmap.loadFromData(fetchedCoverArtBytes);

// The real size will be calculated later by adjustImageAndDialogSize().
resize(100, 100);
show();
setWindowTitle(tr("Fetched Cover Art"));
raise();
activateWindow();

adjustImageAndDialogSize();
}

void DlgCoverArtFullSize::slotLoadTrack(TrackPointer pTrack) {
if (m_pLoadedTrack != nullptr) {
disconnect(m_pLoadedTrack.get(),
Expand Down Expand Up @@ -158,6 +172,10 @@ void DlgCoverArtFullSize::slotCoverFound(

m_pixmap = pixmap;

adjustImageAndDialogSize();
}

void DlgCoverArtFullSize::adjustImageAndDialogSize() {
if (m_pixmap.isNull()) {
coverArt->setPixmap(QPixmap());
hide();
Expand Down
2 changes: 2 additions & 0 deletions src/library/dlgcoverartfullsize.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class DlgCoverArtFullSize
~DlgCoverArtFullSize() override = default;

void init(TrackPointer pTrack);
void initFetchedCoverArt(const QByteArray& fetchedCoverArtBytes);
void mousePressEvent(QMouseEvent* event) override;
void mouseReleaseEvent(QMouseEvent* ) override;
void mouseMoveEvent(QMouseEvent* ) override;
Expand All @@ -38,6 +39,7 @@ class DlgCoverArtFullSize
mixxx::cache_key_t requestedCacheKey,
bool coverInfoUpdated);
void slotTrackCoverArtUpdated();
void adjustImageAndDialogSize();

// slots that handle signals from WCoverArtMenu
void slotCoverMenu(const QPoint& pos);
Expand Down
Loading