~ubuntu-branches/ubuntu/hardy/gtkpod-aac/hardy

« back to all changes in this revision

Viewing changes to src/misc_playlist.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-07-17 18:25:25 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070717182525-rhl5w4pk8lbk6pna
Tags: 0.99.10-2ubuntu1
* Resynchronise with gtkpod 0.9.10-2.
* Hack in dpatch support, since it was removed.
* Rename debian/patches/03-configure.dpatch to
  debian/patches/aac-configure.dpatch.
* Update debian/gtkpod-aac.diff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Time-stamp: <2006-06-24 01:53:45 jcs>
2
 
|
 
1
/*
3
2
|  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
4
3
|  Part of the gtkpod project.
5
4
24
23
|
25
24
|  This product is not supported/written/published by Apple!
26
25
|
27
 
|  $Id: misc_playlist.c,v 1.38 2006/06/23 16:59:23 jcsjcs Exp $
 
26
|  $Id: misc_playlist.c 1595 2007-06-26 13:43:54Z dforsi $
28
27
*/
29
28
 
30
29
#ifdef HAVE_CONFIG_H
35
34
#include "charset.h"
36
35
#include "itdb.h"
37
36
#include "info.h"
38
 
#include "md5.h"
 
37
#include "sha1.h"
39
38
#include "misc.h"
40
39
#include "misc_track.h"
41
40
#include "prefs.h"
914
913
        /* printf("Handling track %d\n", track->ipod_id); */
915
914
 
916
915
        buf = get_track_info (track, TRUE);
917
 
        gtkpod_statusbar_message (_("Processing '%s'"), buf);
 
916
        gtkpod_statusbar_message (_("Processing '%s'..."), buf);
918
917
        g_free (buf);
919
918
                                  
920
919
        while (widgets_blocked && gtk_events_pending ())
922
921
 
923
922
        /* Indicate that file needs to be transfered */
924
923
        track->transferred=FALSE;
925
 
        /* Update MD5 information */
926
 
        /* remove track from md5 hash and reinsert it
 
924
        /* Update SHA1 information */
 
925
        /* remove track from sha1 hash and reinsert it
927
926
           (hash value may have changed!) */
928
 
        md5_track_remove (track);
 
927
        sha1_track_remove (track);
929
928
        /* need to remove the old value manually! */
930
 
        etr->md5_hash = NULL;
931
 
        oldtrack = md5_track_exists_insert (itdb, track);
 
929
        g_free (etr->sha1_hash);
 
930
        etr->sha1_hash = NULL;
 
931
        oldtrack = sha1_track_exists_insert (itdb, track);
932
932
        if (oldtrack) { /* track exists, remove old track
933
933
                          and register the new version */
934
 
            md5_track_remove (oldtrack);
 
934
            sha1_track_remove (oldtrack);
935
935
            gp_duplicate_remove (track, oldtrack);
936
 
            md5_track_exists_insert (itdb, track);
 
936
            sha1_track_exists_insert (itdb, track);
937
937
        }
 
938
        /* mark for conversion / transfer */
 
939
        file_convert_add_track (track);
938
940
    }
939
941
    g_list_free(l_dangling);
940
942
    data_changed (itdb);
985
987
    Playlist* pl_orphaned = NULL;
986
988
    GList * l_dangling[2] = {NULL, NULL}; /* 2 kinds of dangling tracks: with approp
987
989
                                           * files and without */
988
 
    /* 1 - Original file is present on PC and has the same md5*/
 
990
    /* 1 - Original file is present on PC and has the same sha1*/
989
991
    /* 0 - Doesn't exist */
990
992
 
991
993
    gpointer foundtrack ;
1124
1126
                    norphaned++;
1125
1127
 
1126
1128
                    if (localdebug) fprintf(stdout,"to orphaned ");
1127
 
                    if ((dupl_track = md5_file_exists (itdb, fn_orphaned,
 
1129
                    if ((dupl_track = sha1_file_exists (itdb, fn_orphaned,
1128
1130
                                                       TRUE)))
1129
1131
                    {  /* This orphan has already been added again.
1130
1132
                          It will be removed with the next sync */