Giter VIP home page Giter VIP logo

javascript-music's Introduction

Hi, I'm Kenneth Onuorah

I live in Austin, Texas. I graduated from Austin Community College with an Associate's Degree in Computer Science. My main area of interest is Frontend/UI and Software Development.

  • 🔭 I’m currently working on: my blog and bookstore websites
  • 🌱 I’m currently learning: Prisma △ and Cypress🌲

Languages & Technologies ⚙️🛠️

Portfolio 💼

Visit Here

Vercel

Contact Me 📧

javascript-music's People

Contributors

kennethonuorah avatar

Stargazers

 avatar  avatar

Watchers

 avatar

javascript-music's Issues

Issue #10: Order the album songs by their track number (Optional)

Some users may want to listen to their songs in the order the album's artists intended it to be. However, right now album songs are always ordered alphabetically. You can use the tag.tags.track attribute of the jsmediatags library to sort them correctly. tag.tags.track is a string integer, so you can use parseInt() to convert it to a number and set it to a temporary variable.

Where the const album object is first created, have the songs, songArtist, songsB64, & songYear values set to Array(files.length).fill("") by default.

Then, rewrite this section:

jsmediatags.read(file, {
   onSuccess: (tag) => {
       album["songs"].push(tag.tags.title) 
       album["songArtist"].push(tag.tags.artist) 
       album["songYear"].push(tag.tags.year)
   },
   onError: (error) => {
       console.error(error)
   }
})

As this:

const index = 0
jsmediatags.read(file, {
   onSuccess: (tag) => {
       let index = parseInt(tag.tags.track)
       album["songs"][index] = tag.tags.title
       album["songArtist"][index] = tag.tags.artist
       album["songYear"][index] = tag.tags.year
   },
   onError: (error) => {
       console.error(error)
   }
})

The same, likewise, should be done for the FileReader() section:

const reader = new FileReader()
reader.onload = () => {
   console.log(`Reader: ${file.name}`)
   statusText.innerHTML = `Saving ${file.name} in storage...`
   album["songsB64"][index] = `${file.name}_${reader.result}`
}
reader.onerror = (e) => {
   console.error(e)
}
reader.readAsDataURL(file)

This should (ideally) set the songs, B64, artists, and song years to their correct order. Complete Issue #8 before starting this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.