Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6168813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:45:11+00:00 2026-05-23T22:45:11+00:00

Hi I’m trying to create a simple music library for my application that uses

  • 0

Hi I’m trying to create a simple music library for my application that uses sqlite to store information about the files. I want to know how to update my database when the files making up the library change.

  • One way I thought of figuring out whether or not I need to update the db is to count the number of files that make up the library vs. the number of files in the database. This method seems like it would take a lot of time if there were thousands of files though. Is there a better way to do this?

  • How do I ‘update’ my db without actually going through each file again, getting file information such as artist, album, etc, and comparing it with my db to see if I need to add or remove the file from the database?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:45:12+00:00Added an answer on May 23, 2026 at 10:45 pm

    You can use several techniques.

    1. Scan all directories added by the user to see if the last modified timestamp has changed. If it has rescan the file. You can run this in a separate thread at a low priority if you like.
    2. When a user clicks on the audio track in the UI rescan the file. If it doesn’t exist alert the user and remove the entry. If it does exist check the timestamp and update accordingly.
    3. Provide an option to the user to rescan the entire library.
    4. If the timestamp of a folder known to contain songs changes you can rescan it along with any sub-folders and update the library accordingly.
    5. If the file still exists you probably don’t need to remove it from the database.

    Checking the timestamp of the files (both created and modified) will generally give you a good idea of what updates need to be made to the database if any at all.

    You can also alert the user to possible changes and asking them if they want to rescan based on the type of changes detected. Traversing subdirectories and processing a few thousand files is probably not going to take as much time as you think.

    When rescanning a file you don’t really need to compare it to the existing record in the database. Just execute an SQL UPDATE and be done with it. If you aren’t already familiar with SQL I suggest you study and experiment with some of the example statements available around the net. Keep in mind that if you execute a single SQL transaction for each file scanned it will take considerably longer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
I am doing a simple coin flipping experiment for class that involves flipping a
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.