Browse Source

Some minor documentaion and notes added

I guess the project is complete so far. I`ve implemented everything I needed. Adding more functionality will create an unnecessary bloat and `blur` the purpose of this utility. It was a very exciting and useful project for me. I`m not abandoning it, but I don`t think that I`ll need some new feature in the near future
main
Unbewohnte 4 years ago committed by GitHub
parent
commit
ed33ca27c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      OBM.go
  2. 2
      README.md
  3. 2
      manager/parse.go
  4. 2
      util/checks.go
  5. 1
      worker.go

2
OBM.go

@ -43,7 +43,7 @@ func init() {
// parse for `-beatmap` argument
flag.Parse()
// if `-showOrder` is checked - show the message
// if `-showOrder` is checked - show the message and exit
if *showOrder == true {
fmt.Print(orderMessage)
os.Exit(0)

2
README.md

@ -35,7 +35,7 @@ To run - `./OBM` in terminal (on Unix) || `OBM` in command line (on Windows) (a
1. Start the utility again. If it has found the settings file - it will perform the magic according to provided rules
### Flags (starting from version 1.3.4)
### Flags
Right now there are 2 arguments that you can specify before running the program - "beatmap" and "showOrder".
"-beatmap" flag takes a string; it will tell the program to do its work **ONLY** on beatmaps with specified name; others will be ignored.
The names of beatmaps in Osu! consist an id, artist and the name of the soundtrack, so you can

2
manager/parse.go

@ -12,7 +12,7 @@ import (
// parses given .osu file and returns the filename of its background
// NOTE: Osu! beatmap (as whole) can have multiple backgrounds for each .osu file
// the perfect example : https://osu.ppy.sh/beatmapsets/43701#osu/137122
// this is why this functions asks for a certain difficulty (.osu filename) to be sure
// this is why this function asks for a certain difficulty (.osu filename) to be sure
// to return the correct background name
func (BEATMAP *Beatmap) GetBackgroundName(diff string) (string, error) {
beatmapBytes, err := os.ReadFile(filepath.Join(BEATMAP.Path, diff))

2
util/checks.go

@ -5,6 +5,7 @@ import (
"strings"
)
// checks if given path is a directory
func IsDir(path string) bool {
info, err := os.Stat(path)
if err != nil {
@ -45,6 +46,7 @@ func IsImage(filename string) bool {
return false
}
// checks if given directory/file does exist
func DoesExist(path string) bool {
_, err := os.Stat(path)
if err != nil {

1
worker.go

@ -37,6 +37,7 @@ func worker(jobs <-chan job, results chan result, WG *sync.WaitGroup) {
}
// the `starter` that `glues` workers and jobs together
func workerPool(jobs chan job, results chan result, numOfWorkers int, WG *sync.WaitGroup) {
// check if there are less jobs than workers
if numOfWorkers > len(jobs) {

Loading…
Cancel
Save