Commit Graph
100 Commits
Author SHA1 Message Date
aditya-K2 7e5df526c3 Removed some Connect Functions, some import cycles remain 2022-09-02 01:30:17 +05:30
aditya-K2 4ae005cbe7 No need to use globals as a separate package to avoid import cycles 2022-09-02 01:25:33 +05:30
aditya-K2 49c691e04e Fixes: Nil Reference when Sending Notifications
Also Handling illegal presses in specific Views (PlaylistView,
Searchview)
2022-09-01 00:15:38 +05:30
aditya-K2 ff74bf02ba Initial Implementation of Views 2022-08-31 23:42:15 +05:30
aditya-K2 e86ceaca6a Merge branch 'master' into refactor 2022-08-31 18:42:58 +05:30
aditya-K2 02315f4c17 UPDATE: docs 2022-08-31 18:37:25 +05:30
aditya-K2 5ff27748ae Merge branch 'master' into refactor 2022-08-31 15:19:13 +05:30
aditya-K2 d7be3e201d Added Functionality to Specify Different Type of Connections e.g a Unix Socket 2022-08-31 11:28:02 +05:30
aditya-K2 a8959a10e5 Added Info for ProgressBar 2022-08-29 18:04:34 +05:30
aditya-K2 d7044c48b1 New progressBar Primitive
Previous Implementation of progressBar wasn't clean and for a long time
I wanted to make progressBar a Primitive. Which also makes it project
agnostic.

Following changes have been made:

1. Moved `utils.GetText` to `ui.GetProgressGlyph` (As it had no use other
   than for the progressBar
2. Removed the old Implementation of progressBar

How progressBar works as of right now:

All the Values for the progressBar are provided through the
ProgressFunction()

The ProgressFunction should return
Title (Bar's Title), TopText (Box's Title), BarText (The Text Inside the
progressBar), Percentage(Float64 representing the progress Percentage)
2022-08-29 17:36:36 +05:30
aditya-K2 429db5b1e7 Moved notify package 2022-08-29 11:04:12 +05:30
aditya-K2 d380f8d2a0 Update sample_config.yml
As mentioned here:
    https://github.com/aditya-K2/gomp/issues/1#issuecomment-1205090265

~ isn't expanded properly. Until further fix I will add this to the
sample_config as acknowledgment for the error.
2022-08-04 17:45:05 +05:30
aditya-K2 73982220a6 workaround for #26 2022-08-04 03:34:04 +05:30
aditya-K2 6c2458b320 Added Feedback Link 2022-07-29 15:04:05 +05:30
aditya-K2 ccf23a4c13 Handling j, k for an empty playlist (Merge 'err') 2022-05-19 22:52:54 +05:30
aditya-K2 426e9eb919 Added Exception for j, k (down, up) in the playlist view 2022-04-05 23:32:29 +05:30
aditya-K2 43a7a5c010 Better Error Handling & Explanatory Notifications
fix: Earlier using the `showParentContent` function in playlist
view caused the whole view to freeze now it has been fixed.
2022-03-16 02:49:02 +05:30
aditya-K2 b7f7c9cebd Minor Formatting Changes and better error handling 2022-03-16 02:48:53 +05:30
aditya-K2 719a659df6 Better Error Handling 2021-12-31 15:48:58 +05:30
aditya-K2 010f2473ca refactor: Minor Formatting Changes and Refactoring 2021-12-30 18:49:24 +05:30
aditya-K2 4a0a3e18f7 Using tcell.Colors instead of HardCoding Hex Values 2021-12-30 17:17:58 +05:30
aditya-K2 a3c5af06c8 Using a Unique Function
Previously the bug that I mentioned here `https://github.com/aditya-K2/gomp/blob/f7c22833553e99634e032bd389eae6cf1311fd1c/utils/utils.go#L147` was caused due to the
replication of matched Indexes.
Hence using the utils.Unique function to only get the unique elements in the slice.
2021-12-29 23:58:21 +05:30
aditya-K2 f7c2283355 Update Highlighting Algorithm & Using Tcell Styles
The Algorithm now only inserts the color string over a range i.e
if 1, 2, 3 are matches then instead of adding individually at 1, 2, 3
it adds the color string at 1 and null color string at 3. Also Using
tcell Styles for highlighting the table cells.
2021-12-29 22:28:57 +05:30
aditya-K2 921ab9e831 Updated go.mod file 2021-12-28 22:31:52 +05:30
aditya-K2 09297a4974 Adding A new Field to the FileNode -> Title
Previously During Searching the Connection with mpd client was utilised
to get the title for the files this was slowing the search with large
number of files. Now after adding the Title field to the struct the
Field is accessed instead of querying the server this has lead to faster
searches.

[[ Please Note the Title of a Folder would be the last accessed
track from the FileMap. ]]
2021-12-28 10:32:48 +05:30
aditya-K2 a8ae5fb426 Adding more sensible defaults.
1. After Selection during navigating the folder can be added to the
   playlist now.
2. Also Binded Escape to quit the BuffSearchView
2021-12-26 19:23:58 +05:30
aditya-K2 7b35d30ef7 Changed Default Key Mappings and updated The Documentation 2021-12-26 14:04:13 +05:30
aditya-K2 175b694a4d Implementing Simple Buffer Searching
Searching the Global Database although is enough but I have felt a need to have a
quick and fast search option to search the current buffer.

Buffer Search is also one of the views It can be only turned on if the File Browser
has focus. ( Thinking of making it global ). The Searching is done
through the fuzzy module. FileNode now implements the Source Interface.
The Changed Function of the Search Bar checks for text changes and then
modifies the Matches Variable which is used by the Update Function to
Draw the Results. The Results have the Matching Characters Highlighted
Differently. Maximum of 15 results are displayed to avoid lag. Upon
Selecting the Result through the Search Bar navigation is possible and
selection of the item is done the same way it works for file Browser.
After Selection the Focus is returned Back to the File Browser. For The
Tracks only the title is used for searching.
2021-12-26 00:18:23 +05:30
aditya-K2 659becf3fb chore: minor changes 2021-12-24 21:15:17 +05:30
aditya-K2 0118886d5e chore: Added More Informative Comments 2021-12-24 15:46:42 +05:30
aditya-K2 79872cac08 Update: Readme 2021-12-24 07:00:32 +05:30
aditya-K2 6405bebeed minor formatting change 2021-12-23 21:12:09 +05:30
aditya-K2 130af3aa0e Update Documentation 2021-12-23 20:49:25 +05:30
aditya-K2 f56eb1cf1f Removing Globals
Globals are no longer needed instead I am connecting each part with (
what were previously ) globals. Also Renaming SetRenderer to
ConnectRenderer which describes the name more precisely
2021-12-23 20:20:27 +05:30
aditya-K2 b587f5acfd moving notification to notification package inside ui 2021-12-23 00:16:07 +05:30
aditya-K2 33603e1450 Better Focusing Model
Previously I was using the InsidePlaylist and InsideSearchView boolean
values which was a very hacky and unscalable way. Instead I am using a
focus map which can be queried to check which view has focus. Also the
Pages Implementation is kind of on hold because it has a lot of problems
for e.g resizing doesn't seem to work as I imagined. I am keeping that
Idea on hold right now.
2021-12-22 23:49:16 +05:30
aditya-K2 5031477cf8 Rename : fileBrowser.go -> files.go 2021-12-22 21:43:45 +05:30
aditya-K2 f56169cbd3 moving notification to ui package 2021-12-22 21:20:01 +05:30
aditya-K2 6390039ea9 moving lastfm.go render.go imageUtils.go to the new render package 2021-12-22 21:19:37 +05:30
aditya-K2 6b7fff82b7 minor changes in formatting 2021-12-22 20:42:05 +05:30
aditya-K2 0d9227e019 moving app.go progressbar.go to the new ui package 2021-12-22 20:39:01 +05:30
aditya-K2 a54bfc4948 moving client.go filebrowser.go to the new client package 2021-12-22 19:56:57 +05:30
aditya-K2 d1306f194f Making r (Renderer) Global RENDERER 2021-12-22 17:54:14 +05:30
aditya-K2 7bb59ef102 chore: Update Readme 2021-12-19 17:43:28 +05:30
aditya-K2 6ccd90b36b minor changes 2021-12-19 01:43:22 +05:30
aditya-K2 3eb2138ed5 chore: Update AUR package 2021-12-17 02:34:07 +05:30
aditya-K2 0db49ca23d added aur package 2021-12-17 01:35:13 +05:30
aditya-K2 03e0dc40ab Merge branch 'master' of github.com:aditya-K2/goMP 2021-12-17 01:07:31 +05:30
aditya-K2 ae1b05c203 RENAME : goMP -> gomp
Renaming goMP to gomp as it feels kind of awkward to have two upper case
letters in a name of cli program.
2021-12-17 01:06:18 +05:30
aditya-K2 d1f8751af8 moving gh-pages to docs folder 2021-12-15 10:26:24 +05:30
aditya-K2 1e31d56dc7 deprecated: CACHE_FILE 2021-12-14 14:39:03 +05:30
aditya-K2 65182b2b42 minor changes 2021-12-14 14:30:31 +05:30
aditya-K2 cf3101d778 Merging Master 2021-12-14 14:29:07 +05:30
aditya-K2 fee7c6dc4d Update README 2021-12-13 21:04:45 +05:30
aditya-K2 bd08b3be24 Moving Documentation to Github Pages 2021-12-13 20:10:06 +05:30
aditya-K2 b59f0ada12 Rename App.go -> app.go 2021-12-13 01:46:49 +05:30
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 bc3e5b6741 Updated Documentation 2021-12-13 00:15:53 +05:30
aditya-K2 75d5d13fbe Checking for the / at the back 2021-12-13 00:15:16 +05:30
aditya-K2 73aebcd0a0 Added Check for / at the end in directory names 2021-12-13 00:13:16 +05:30
aditya-K2 2e1e0938c0 Merge branch 'master' of github.com:aditya-K2/goMP into cache 2021-12-13 00:10:55 +05:30
aditya-K2 9190d37c64 minor changes 2021-12-10 02:31:47 +05:30
aditya-K2 cf9b492f59 Better Documentation 2021-12-10 02:20:37 +05:30
aditya-K2 536b12cf66 Update sample_config 2021-12-09 09:38:59 +05:30
aditya-K2 0bd47c5d3f New Copy Function 2021-12-09 02:34:49 +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 10566d87a1 No Need to Load and Write Cache now. 2021-12-09 02:30:59 +05:30
aditya-K2 1d9fe23b00 if the image is not extracted copy the default image to the image path and return the path to the default image for checking the lastfm api 2021-12-09 02:29:53 +05:30
aditya-K2 62bcda33cb Setting up Defaults 2021-12-09 02:28:42 +05:30
aditya-K2 4d55f233d0 Better Way of Caching
Instead of Caching by maintaining a cache file as mentioned here https://github.com/aditya-K2/goMP/issues/14#issuecomment-989141798
We can directly check if the file exists if it exists then we can just
pass the path to it else we can copy the default image to the path of
the imagePath
2021-12-09 02:25:46 +05:30
aditya-K2 b99bdd4e4e Update Readme 2021-12-09 02:17:38 +05:30
aditya-K2 950a2cd34a Merge branch 'cache' 2021-12-09 02:13:42 +05:30
aditya-K2 e6f30f4081 Update Readme 2021-12-09 02:13:06 +05:30
aditya-K2 51794d6324 Merge branch 'master' of github.com:aditya-K2/goMP 2021-12-08 00:43:59 +05:30
aditya-K2 abb47a8818 Update Sample Config 2021-12-08 00:42:50 +05:30
aditya-K2 ce65aeaab4 Fixes #12
This fixes The Issue when a song with unknown duration was played then the percentage was
calculated wrong and the slice was getting out of bound.

fix : I have added a check for the duration.
2021-11-29 15:19:33 +05:30
aditya-K2 eb1b07006d UPDATE README 2021-11-29 00:21:58 +05:30
aditya-K2 9ca7b34586 UPDATE README 2021-11-29 00:20:52 +05:30
aditya-K2 493a50b61b No Need of search package now 2021-11-28 23:41:50 +05:30
aditya-K2 95594dd2ab Sending Some Informational Notifications 2021-11-28 23:38:52 +05:30
aditya-K2 baa063a712 Implementing the library 2021-11-28 23:33:34 +05:30
aditya-K2 acc494682a Using the fuzzy library 2021-11-28 23:33:25 +05:30
aditya-K2 0c98bef74a Generating the Artist Tree CONTENT
This will be helpful to generate the slice only once.
2021-11-28 23:32:40 +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 3195223e82 Added Functionality to Point path to default Img
Sometimes the image is not found and for those artist/albums there is no
way for pointing the image path to default image path so some helper
functions have been added so that we can point them to default Image.
2021-11-26 21:59:50 +05:30
aditya-K2 7da86291dc Replacing / with _ which lead to errors when creating image. 2021-11-25 20:08:51 +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 68ef09544c Doing Cache Related Initilisations and Setup 2021-11-20 21:47:29 +05:30
aditya-K2 84c4b4313c Now it is neccessary to pass the imagePath
Now it is neccessary to pass imagePath to the image Extracting
functions.
2021-11-20 21:45:32 +05:30
aditya-K2 1014981dcb Added Simple Helper Functions
Following Functions have been added :

    1. SetCacheDir : Sets the Cache Directory
    2. CHANGE AddToCache the image path is now the Cache Directory +
       image Path
2021-11-20 21:38:38 +05:30
aditya-K2 42832491d0 New Functions For the Caching Module
The Following New Functions have been added
    1. AddToCache Adds to the CACHE_LIST map
    2. GetFromCache Retrieves path from CACHE_LIST map
    3. Rename WriteToCache -> WriteCache()
    4. GenerateName now replaces spaces with underscores.
2021-11-20 20:27:05 +05:30
aditya-K2 51b63a19e5 Hopefully Fixes the bugs
Sometimes on adding a song/artist/album all songs were added to the
playlist. This was because of the wrong order in which the array
elements were stored. Hopefully this fixes it.
2021-11-17 15:06:18 +05:30
aditya-K2 fb6b34cf19 UPDATE README 2021-11-17 00:45:15 +05:30
aditya-K2 2df207102c UPDATE README 2021-11-17 00:39:14 +05:30
aditya-K2 7f1c3f7c55 Simple Implementation of Searching.
This is a very simple Implementation of searching like playlist view
and file view there is an boolean value that is checked in the draw
function to check if whether or not to draw the Search view
Later on I am thinking of rewriting this whole mechanism with pages
which will make this more modular.

The Boolean values are set and unset by the navigation menu and the done
functions.
2021-11-16 20:53:22 +05:30
aditya-K2 34c6a7a3af Some Bug Fixes and Option to add and play.
BUG FIX :

    1. Artist Added Notification moved out of for loop
    this caused it to sustain for more than one second.

FEATURE :

    Added Functionality to pass addAndPlay bool which defines if
    the title is played after adding or not. Helpful for l and a
    keybindings
2021-11-16 20:29:46 +05:30
aditya-K2 fde7bdd1c7 Added Search Section 2021-11-16 20:06:12 +05:30
aditya-K2 4c7378e77c Added Default Key To Navigate to Search View with the 4 Button 2021-11-16 20:01:02 +05:30