timheuer / taglib-sharp-portable

.NET Portable Class Library implementation of TagLib# (forked from TagLib# main project)
Other
58 stars 33 forks source link

tagFile.Save(); #13

Closed ghost closed 8 years ago

ghost commented 8 years ago

This line of code (tagFile.Save();) needs around 20-30 seconds to execute in my UWP app... Any help would be much appreciated...Thank you!

                    try
                    {
                        var writeStream = await file.OpenAsync(FileAccessMode.ReadWrite);
                        var tagFile = TagLib.File.Create(new StreamFileAbstraction(file.Name, writeStream.AsStreamForRead(), writeStream.AsStreamForWrite()));
                        var tag = tagFile.Tag;
                        tag.AlbumArtists = new string[] { artistName };
                        tag.Title = fileName;
                        tag.Album = albumName;
                        tagFile.Save();
                        tagFile.Dispose();
                        writeStream.Dispose();
                    }
                    catch
                    {

                    }
ghost commented 8 years ago

Hi, Tim! I am having one very strange problem here... In my UWP app tagging doesn't last the same time for every user. For me and most of my users it is like 20-30 seconds and for some others it is 10 seconds. But there are also those with 1-2 seconds. Those are the lucky ones... I am assuming that is the normal tagging tiime, but how then it is different from user to user in my app?

ghost commented 8 years ago

Sorry Tim, but I don't have time for sample project... Can I send you the app project privately instead?

timheuer commented 8 years ago

@IgorGiga yes send it to me and I'll take a look (tim@timheuer.com)

ghost commented 8 years ago

Ok, tomorrow I will send it to you! Thank you for helping me...

timheuer commented 8 years ago

I got your project and after a few tries for me it is 'quick' (about 2s) and I don't see anything that is taking that long. The only thing I can think of is the type of device for those who takes longer as well as the file they are using (I used it on 3 files that were about 1m30s in length).

ghost commented 8 years ago

Well, I guess that then I cannot do anything to speed it up... On my L620 it usually takes 20-30 seconds... Lol

ghost commented 8 years ago

I have tested the app with various videos, and tagging time really depends on file size... Propably on something else too...