~quadrispro/cmus/trunk

« back to all changes in this revision

Viewing changes to cmus.c

  • Committer: Gregory Petrosyan
  • Author(s): Siim Salonen
  • Date: 2012-09-29 08:01:59 UTC
  • Revision ID: git-v1:151c330a881d666e4256d4c953e3f5f1fc6e89fa
Add option to skip initial metadata loading

When I use network filesystems and trying to add many tracks then it
takes hours to complete.
In my case ~45GB mp3 collection mounted with sshfs over 3G network.
skip_track_info false: worker job: 9586.65 (2.6h), 8531 tracks
skip_track_info true : worker job: 266.30, 9448 tracks (includes .jpg etc.)

When I have time and bandwith, I can reload track(s) metadata using
'update-cache' or 'win-update-cache' commands.

TODO: fetch tags when file starts playing

[gp: formatting + extra is_http_url() check]
Signed-off-by: Gregory Petrosyan <gregory.petrosyan@gmail.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
        struct track_info *ti;
111
111
 
112
112
        cache_lock();
113
 
        ti = cache_get_ti(filename);
 
113
        ti = cache_get_ti(filename, 0);
114
114
        cache_unlock();
115
115
        if (!ti) {
116
116
                error_msg("Couldn't get file information for %s\n", filename);
164
164
        return FILE_TYPE_FILE;
165
165
}
166
166
 
167
 
void cmus_add(add_ti_cb add, const char *name, enum file_type ft, int jt)
 
167
void cmus_add(add_ti_cb add, const char *name, enum file_type ft, int jt, int force)
168
168
{
169
169
        struct add_data *data = xnew(struct add_data, 1);
170
170
 
171
171
        data->add = add;
172
172
        data->name = xstrdup(name);
173
173
        data->type = ft;
 
174
        data->force = force;
174
175
        worker_add_job(jt, do_add_job, free_add_job, data);
175
176
}
176
177