Skip to content

Commit

Permalink
Fix album art and connection bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan Linnell committed Jun 12, 2012
1 parent c966a68 commit a8b4188
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
4 changes: 2 additions & 2 deletions hgdclient.pas
Expand Up @@ -153,8 +153,8 @@ constructor THGDClient.Create(Debug: boolean);
FStatusMessage := 'Not connected.';
FDebug := Debug;

//2 second socket timeout
Timeout := 2000;
//10 second socket timeout
Timeout := 10000;
Socket := TTCPBlockSocket.Create();
FEncrypted := False;
end;
Expand Down
2 changes: 1 addition & 1 deletion hgdcx.lpi
Expand Up @@ -8,7 +8,7 @@
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="hgdc-x"/>
<Title Value="Hgdc-X"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
Expand Down
2 changes: 1 addition & 1 deletion hgdcx.lpr
Expand Up @@ -35,7 +35,7 @@
{$R *.res}

begin
Application.Title := 'hgdc-x';
Application.Title:='Hgdc-X';
Application.Initialize;
Application.CreateForm(TfrmMain, frmMain);
Application.CreateForm(TfrmAbout, frmAbout);
Expand Down
14 changes: 7 additions & 7 deletions main.lfm
@@ -1,7 +1,7 @@
object frmMain: TfrmMain
Left = 310
Left = 350
Height = 527
Top = 106
Top = 136
Width = 579
AllowDropFiles = True
Caption = 'Hgdc-X'
Expand Down Expand Up @@ -8398,8 +8398,8 @@ object frmMain: TfrmMain
Width = 568
Anchors = [akTop, akLeft, akRight]
Caption = 'Now Playing'
ClientHeight = 99
ClientWidth = 560
ClientHeight = 101
ClientWidth = 564
TabOrder = 1
object lblNoAlbumArt: TLabel
Left = 7
Expand All @@ -8417,8 +8417,8 @@ object frmMain: TfrmMain
object lblNoPlaylist: TLabel
Left = -2
Height = 16
Top = 38
Width = 566
Top = 40
Width = 570
Alignment = taCenter
Anchors = [akLeft, akRight, akBottom]
AutoSize = False
Expand Down Expand Up @@ -8742,7 +8742,7 @@ object frmMain: TfrmMain
ParentFont = False
end
object btnCrapSong: TSpeedButton
Left = 526
Left = 530
Height = 32
Hint = 'Vote off current song.'
Top = 2
Expand Down
8 changes: 7 additions & 1 deletion main.pas
Expand Up @@ -305,8 +305,12 @@ procedure TfrmMain.imAboutClick(Sender: TObject);

procedure TfrmMain.imLoginClick(Sender: TObject);
begin
tmrPlaylist.Enabled := False;

if mrOK = frmLogin.ShowModal() then
ApplyChanges();

tmrPlaylist.Enabled := True;
end;

procedure TfrmMain.ProgressCallback(Percentage: integer);
Expand Down Expand Up @@ -378,14 +382,16 @@ procedure TfrmMain.tmrPlaylistTimer(Sender: TObject);
Inc(FArtworkAttempts);
imNowPlaying.Visible := False;
lblNoAlbumArt.Visible := True;
FCurrentlyDisplayedArtwork := '';
end;

if (FArtworkAttempts = MAX_ARTWORK_ATTEMPTS) then
begin
Log('Too many artwork attempts, not trying again.');

//Ensure artwork wont fetch again...
FCurrentlyDisplayedArtwork := NowPlayingSong.Artist + ':' +
NowPlayingSong.Album;

FArtworkAttempts := 0;
end;
end;
Expand Down

0 comments on commit a8b4188

Please sign in to comment.