コード例 #1
0
ファイル: DumpIndex.cs プロジェクト: ArsenShnurkov/beagle-1
    static string RemapUriToPath(Hashtable all_hits_by_uri, Hit hit)
    {
        string exact_name;

        if (hit.GetFirstProperty(Property.IsChildPropKey) == "true")
        {
            exact_name = hit.GetFirstProperty("parent:" + Property.ExactFilenamePropKey);
        }
        else
        {
            exact_name = hit.GetFirstProperty(Property.ExactFilenamePropKey);
        }

        string parent_uri_str = hit.GetFirstProperty(Property.ParentDirUriPropKey);

        if (parent_uri_str == null)
        {
            return(exact_name);
        }
        else
        {
            return(Path.Combine(RemapUriToPath(all_hits_by_uri, (Hit)all_hits_by_uri [parent_uri_str]),
                                exact_name));
        }
    }
コード例 #2
0
ファイル: DumpIndex.cs プロジェクト: ArsenShnurkov/beagle-1
	static string RemapUriToPath (Hashtable all_hits_by_uri, Hit hit)
	{
		string exact_name;

		if (hit.GetFirstProperty (Property.IsChildPropKey) == "true")
			exact_name = hit.GetFirstProperty ("parent:" + Property.ExactFilenamePropKey);
		else
			exact_name = hit.GetFirstProperty (Property.ExactFilenamePropKey);

		string parent_uri_str = hit.GetFirstProperty (Property.ParentDirUriPropKey);

		if (parent_uri_str == null)
			return exact_name;
		else
			return Path.Combine (RemapUriToPath (all_hits_by_uri, (Hit) all_hits_by_uri [parent_uri_str]),
					     exact_name);
	}
コード例 #3
0
        public static LibraryTrackInfo HitToTrack(Hit hit)
        {
            uint track_number = 0;
            uint track_count = 0;
            int year = 0;

            try {
                track_number = UInt32.Parse(hit.GetFirstProperty("fixme:tracknumber"));
            } catch { }

            try {
                track_count = UInt32.Parse(hit.GetFirstProperty("fixme:trackcount"));
            } catch { }

            try {
                year = Int32.Parse(hit.GetFirstProperty("fixme:year"));
            } catch { }

            try {
                LibraryTrackInfo track = new LibraryTrackInfo(
                    new SafeUri(hit.Uri),
                    hit.GetFirstProperty("fixme:artist"),
                    hit.GetFirstProperty("fixme:album"),
                    hit.GetFirstProperty("fixme:title"),
                    hit.GetFirstProperty("fixme:genre"),
                    track_number, track_count, year,
                    TimeSpan.Zero, null, RemoteLookupStatus.NoAttempt);

                return track;
            } catch {
                return null;
            }
        }
コード例 #4
0
ファイル: BeaglePlugin.cs プロジェクト: snorp/tangerine
 private int GetHitInteger(Hit hit, string key)
 {
     try {
         return Int32.Parse (hit.GetFirstProperty (key));
     } catch {
         return 0;
     }
 }