Commit Graph

15 Commits

Author SHA1 Message Date
aditya-K2
da47c9b10c Moving imageUtils.go to utils package 2021-12-13 01:43:20 +05:30
aditya-K2
9b60cbc98e Moving utils.go to utils package 2021-12-13 01:35:40 +05:30
aditya-K2
75d5d13fbe Checking for the / at the back 2021-12-13 00:15:16 +05:30
aditya-K2
13b07bf7f7 Update in the Rendering Routine
With the updates in the caching mechanism we check if the file exists in
cache if yes then extractedImagePath now points to that path else
we generate the name for the image and pass the image to extractImage
and it passes the default value if no embedded image was found and
checks in the lastfm api and the rest works the same.
2021-12-09 02:32:02 +05:30
aditya-K2
95594dd2ab Sending Some Informational Notifications 2021-11-28 23:38:52 +05:30
aditya-K2
2a2e6336e4 Implementing the previous commit
In main.go we are setting the default image path.
and whenever we don't find the image through lastfm we pointhepath to
default image in render.go
2021-11-26 22:02:20 +05:30
aditya-K2
e9bcb8ff63 Extracted the process into a new function : getImagePath 2021-11-20 22:15:10 +05:30
aditya-K2
b91120252b Simple Implementation of caching
Now before rendering the image the image is checked in the cache if it
exists then the image is rendered else it is added to the cache and then
rendered.
2021-11-20 21:47:43 +05:30
aditya-K2
5623551b61 Now a notification is sent when Image is downloaded from lastfm 2021-11-14 12:04:54 +05:30
aditya-K2
ee7cc71879 Update to Rendering Routine.
Following changes have been made:

     1. The OpenImage() function now checks if the image returned by the
	mp3 and flac parsers is the default image if it is true then it
	will query the lastfm api for cover image if no error is
	received then the path to that downloaded image is passed else
	the path is unchanged ( that is it will be the default image )
2021-11-13 11:44:49 +05:30
aditya-K2
cad01293c8 Rewriting image Rendering
Now individual parsing of mp3, flac files is done.
and then they are rendered
2021-11-08 11:48:49 +05:30
aditya-K2
5ad7b90844 Added a config parser
Add a config.yml/config.toml file to $HOME/.config/goMP/ so that user
configurations are read.
2021-11-05 12:40:46 +05:30
aditya-K2
bae972f697 Now the Image is resized according to font Size
Image is now resized according to the font size and also a new
globals.go files is added which contains all the globals.

the Image width can also be changed according to use by adding or
substracting pixels to it by changing the globals

IMAGE_WIDTH_EXTRA_X, IMAGE_WIDTH_EXTRA_Y

Also, now there is no need to specify where the music directory is
the mpd.conf file in `~/.config/mpd/` is automatically parsed for music
directory
2021-10-29 13:54:06 +05:30
aditya-K2
93e6885ae9 Additional Padding for Cover art to fit correctly
As specified in #2 the image gets out of the preview box, the previous
commit solves the problem but the image placement in the box differs
from terminal to terminal it might need some extra padding so user can
define some extra padding in the render.go
2021-10-29 10:14:57 +05:30
aditya-K2
9b1e8fd4f7 Image Preview Utilities
render.go : This File Contains the implementation for the Renderer which
is a channel that will receive strings to the path of decoded images)
the path is sent with the help of Send() method. The Start() method
starts the go routine OpenImage() this function blocks the image as it
keeps listening over the channel. which helps in not drawing the image
again and again.

imageUtils.go: This file contains the helper function for decoding
images.
2021-10-24 13:15:45 +05:30